我如何检查输入的文件是正确还是错误 [英] how do i check if the entered file is correct or wrong
本文介绍了我如何检查输入的文件是正确还是错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果我在文件文本框中输入了错误的路径,我需要一条弹出消息。
I need a popup message if i enter some wrong path in the file textbox.
只有在我输入正确的路径后才能启用确定按钮。
And the OK button should be enabled only after i enter a correct path.
请告诉我。
谢谢
Akshay
推荐答案
嗨anonymous_3210,
我不确定我是否能理解你想做什么。
Hi anonymous_3210,
I'm not sure if I can understand what you want to do.
如果你需要弹出消息,使用 MessageBox 。
If you need a popup message, use MessageBox.
如果您需要检查某个文件夹或文件是否存在,请使用 System.IO。 File.Exists (文件名)或 System.IO。 Directory.Exists (文件夹路径)。
问候,
If you need to check if a certain folder or file exist, use System.IO.File.Exists(file name) or System.IO.Directory.Exists(folder path).
Regards,
这篇关于我如何检查输入的文件是正确还是错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文