浏览C#中的代码编码 [英] Browse code coding in C#

查看:57
本文介绍了浏览C#中的代码编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


如何在C#中执行浏览选项编码.当我单击浏览按钮时,它应该显示文件的有效路径.

问候
Balamurugan

Hi,
How to execute the coding for browse option in C#. When I''m clicking browse button it should show the valid path of the file.

Regards
Balamurugan

推荐答案

巴拉,

您可以在ASp.net中使用文件上载按钮

< asp:fileupload id ="upload" runat ="server"/>


如果使用,则可以获取浏览文件

谢谢
Mohan
Hi Bala,

You can use file Upload Button in ASp.net

<asp:fileupload id="upload" runat="server" />


if you use then you can get browse files

Thanks
Mohan


巴拉

您可以在C#中尝试使用此OpenFileDialog


OpenFileDialog fdlg =新的OpenFileDialog();
fdlg.Title ="C#角落打开文件对话框";
fdlg.InitialDirectory = @"c:\";
fdlg.Filter =所有文件(*.*)| *.* |所有文件(*.*)| *.*";
fdlg.FilterIndex = 2;
fdlg.RestoreDirectory = true;
if(fdlg.ShowDialog()== DialogResult.OK)
{
textBox1.Text = fdlg.FileName;
}
Hi bala

You can try this OpenFileDialog in C#


OpenFileDialog fdlg = new OpenFileDialog();
fdlg.Title = "C# Corner Open File Dialog" ;
fdlg.InitialDirectory = @"c:\" ;
fdlg.Filter = "All files (*.*)|*.*|All files (*.*)|*.*" ;
fdlg.FilterIndex = 2 ;
fdlg.RestoreDirectory = true ;
if(fdlg.ShowDialog() == DialogResult.OK)
{
textBox1.Text = fdlg.FileName ;
}


这篇关于浏览C#中的代码编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆