打开特定文件夹,然后从该文件夹加载选定文件 [英] Open specific folder and than load a selcted file from that folder
本文介绍了打开特定文件夹,然后从该文件夹加载选定文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
i想要打开一个特定文件夹,点击打开按钮并在该文件夹中.XML扩展文件应该只过滤并显示,之后我可以选择任何.xml文件和加载。
请帮助这个..
i需要获胜形式。
hi
i want to open a specifc folder clicking on open button and in that folder .XML extension file should be filter and show only and after than i can select any of the .xml file and load.
plase help on this..
i need thi in win form.
推荐答案
using System;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
// Show the dialog and get result.
DialogResult result = openFileDialog1.ShowDialog();
if (result == DialogResult.OK) // Test result.
{
}
Console.WriteLine(result); // <-- For debugging use.
}
}
}
和diaolog box过滤器物业
过滤=XML | * .xml
这篇关于打开特定文件夹,然后从该文件夹加载选定文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文