问题描述
大家好,
我有一个文件打开对话框,该对话框允许用户从驱动器中选择文件.当用户在表单的标题栏中进行选择时,我需要动态显示所选文件的路径和文件名.
例如:
C:\ Documents and Settings \我的文档\我的图片
在上面的示例中,我需要在用户选择时动态显示其中的每一个.
c:\ Documents and Settings
c:\ Documents and Settings \我的文档
c:\ Documents and Settings \我的文档\我的图片等.
你能帮我吗?
在此先感谢您.
Hi all,
I have a file open dialog box which allows the user to select a file from the drive. I need to display the path and file name of the selected file dynamically as and when the user selects in the title bar of the form.
For ex:
C:\Documents and Settings\My Documents\My Pictures
In the above example I need to dynamically display each of these when user selects.
c:\Documents and Settings
c:\Documents and Settings\My Documents
c:\Documents and Settings\My Documents\My Pictures etc..
Can you help me?
Thanks in advance.
推荐答案
// in your file select handler
this.Text = selectedfilename;
这篇关于动态显示所选文件的路径和文件名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!