如何使用OpenFileDialog控件将附加或选定的文件放入文本框中 [英] How to get attached or selected files into a textbox using OpenFileDialog control

查看:38
本文介绍了如何使用OpenFileDialog控件将附加或选定的文件放入文本框中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi ,,,



如何使用OpenFileDialog控件将附加或选定的文件放入文本框中??



我试过这段代码..



 FileAttachtxt.Text = openFileDialog1.SafeFileNames.ToString(); 







但是返回一个数组...

试试这个:

试试这个:

 FileAttachtxt.Text =  String  .Join(  ;,openFileDialog1.SafeFileNames); 



PS:如果你没有回复我的评论,我不会收到通知,所以请以适当的方式使用页面小部件。


首先,请阅读: OpenFileDialog(System.Windows.Forms) ) [ ^不仅仅是看看: C#OpenFileDialog教程 [ ^ ]

hi,,,

How to get attached or selected files into a textbox using OpenFileDialog control...?

I tried this code..

FileAttachtxt.Text =openFileDialog1.SafeFileNames.ToString();




but returning an array...

解决方案

Try this:

FileAttachtxt.Text =String.Join(";", openFileDialog1.SafeFileNames);


PS: if you don''t reply to my comment, I wont be notified, so please use the page widgets in the appropriate way.


First of all, read this: OpenFileDialog (System.Windows.Forms)[^] than have a look at: C# OpenFileDialog Tutorial[^]


这篇关于如何使用OpenFileDialog控件将附加或选定的文件放入文本框中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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