<small id='a5OdP'></small><noframes id='a5OdP'>

    1. <legend id='a5OdP'><style id='a5OdP'><dir id='a5OdP'><q id='a5OdP'></q></dir></style></legend>
      <i id='a5OdP'><tr id='a5OdP'><dt id='a5OdP'><q id='a5OdP'><span id='a5OdP'><b id='a5OdP'><form id='a5OdP'><ins id='a5OdP'></ins><ul id='a5OdP'></ul><sub id='a5OdP'></sub></form><legend id='a5OdP'></legend><bdo id='a5OdP'><pre id='a5OdP'><center id='a5OdP'></center></pre></bdo></b><th id='a5OdP'></th></span></q></dt></tr></i><div id='a5OdP'><tfoot id='a5OdP'></tfoot><dl id='a5OdP'><fieldset id='a5OdP'></fieldset></dl></div>

        <bdo id='a5OdP'></bdo><ul id='a5OdP'></ul>

    2. <tfoot id='a5OdP'></tfoot>

      获取C#保存对话框的文件路径

      时间:2023-09-14
      <tfoot id='QsiB5'></tfoot>
      • <legend id='QsiB5'><style id='QsiB5'><dir id='QsiB5'><q id='QsiB5'></q></dir></style></legend>
      • <small id='QsiB5'></small><noframes id='QsiB5'>

          • <bdo id='QsiB5'></bdo><ul id='QsiB5'></ul>
            1. <i id='QsiB5'><tr id='QsiB5'><dt id='QsiB5'><q id='QsiB5'><span id='QsiB5'><b id='QsiB5'><form id='QsiB5'><ins id='QsiB5'></ins><ul id='QsiB5'></ul><sub id='QsiB5'></sub></form><legend id='QsiB5'></legend><bdo id='QsiB5'><pre id='QsiB5'><center id='QsiB5'></center></pre></bdo></b><th id='QsiB5'></th></span></q></dt></tr></i><div id='QsiB5'><tfoot id='QsiB5'></tfoot><dl id='QsiB5'><fieldset id='QsiB5'></fieldset></dl></div>

                  <tbody id='QsiB5'></tbody>

                本文介绍了获取C#保存对话框的文件路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我有一个保存对话框,当我按下按钮时会弹出.但是我当时不想保存文件,我想取名称并将其放在按钮旁边的文本框中,以便稍后使用该名称.

                I've got a save dialog box which pops up when i press a button. However i dont want to save a file at that point, i want to take the name and place it in the text box next to the button, for the name to be used later.

                谁能告诉我如何从保存对话框中获取文件路径以便以后使用?

                Can anybody tell me how to obtain the file path from the save dialog box to use it later?

                推荐答案

                这是我刚刚写的非常快的示例代码......而不是 Console.Write 你可以简单地将路径存储在一个变量中并稍后使用它.

                Here is a sample code I just wrote very fast... instead of Console.Write you can simply store the path in a variable and use it later.

                SaveFileDialog saveFileDialog1 = new SaveFileDialog(); 
                saveFileDialog1.InitialDirectory = Convert.ToString(Environment.SpecialFolder.MyDocuments); 
                saveFileDialog1.Filter = "Your extension here (*.EXT)|*.ext|All Files (*.*)|*.*" ; 
                saveFileDialog1.FilterIndex = 1; 
                
                if(saveFileDialog1.ShowDialog() == DialogResult.OK) 
                { 
                    Console.WriteLine(saveFileDialog1.FileName);//Do what you want here
                } 
                

                这篇关于获取C#保存对话框的文件路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:Windows 窗体中的提示对话框 下一篇:使用 ShowDialog 显示对话框时如何控制对话框的位置?

                相关文章

                      <bdo id='noDe6'></bdo><ul id='noDe6'></ul>
                    <tfoot id='noDe6'></tfoot>

                  1. <i id='noDe6'><tr id='noDe6'><dt id='noDe6'><q id='noDe6'><span id='noDe6'><b id='noDe6'><form id='noDe6'><ins id='noDe6'></ins><ul id='noDe6'></ul><sub id='noDe6'></sub></form><legend id='noDe6'></legend><bdo id='noDe6'><pre id='noDe6'><center id='noDe6'></center></pre></bdo></b><th id='noDe6'></th></span></q></dt></tr></i><div id='noDe6'><tfoot id='noDe6'></tfoot><dl id='noDe6'><fieldset id='noDe6'></fieldset></dl></div>
                  2. <legend id='noDe6'><style id='noDe6'><dir id='noDe6'><q id='noDe6'></q></dir></style></legend>
                  3. <small id='noDe6'></small><noframes id='noDe6'>