如何从savefiledialogue输入文件名获取文件名 [英] How to get file name when from savefiledialogue typed filename

查看:143
本文介绍了如何从savefiledialogue输入文件名获取文件名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


i想知道如何从savefiledialogue输入文件名

解决方案

 SaveFileDialog1.FileName 



单击对话框上的SAVE按钮后,保存对话框的这个属性将为您提供带路径的文件名。



要获得带扩展名的文件名,您可以尝试:

 System.IO.Path.GetFileName(SaveFileDialog1.FileName); 





没有扩展名:

 System.IO.Path.GetFileNameWithoutExtension(SaveFileDialog1.FileName); 


Hi i wanna know How to get a file name when from savefiledialogue typed filename

解决方案

SaveFileDialog1.FileName


This property of save dialog will give you the file name with path after you click the SAVE button on the dialog.

To get only file name with extension you can try this :

System.IO.Path.GetFileName(SaveFileDialog1.FileName);



And without extension :

System.IO.Path.GetFileNameWithoutExtension(SaveFileDialog1.FileName);


这篇关于如何从savefiledialogue输入文件名获取文件名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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