好像File类下面有个类似于FileExist字样的方法,可能名字不对,你可以找找看
解决方案 »
- vs2010调用PYTHON的一个错误
- 初学c# 怎么读取textbox中的随机数
- udp socket 通讯问题
- 如何修改二进制文件的内容
- 为什么插入一行不行?
- (求救)用.NET下的winform在知道网址的情况下,怎么遍历这个网址下的所有文件(也就是目录下的所有文件)?
- DataGrid里不用数据连接,怎么样把一个table里的数据显示在datagrid里面啊??
- abc(123)用正则表达式怎么写,才能把abc和123分别放在一个捕获组里?
- 关于VSTO的问题,请赐教
- ————问一个关于GIF图片的问题。~~~~
- System.Timers.Timer和System.threading.timer和System.windows.form.timer有什么区别?我想创建一个windows服务,请问应该用哪一个timer
- =====C#.net的dataGrid的Columnstyle怎么不多自带几种风格?有好一点的解决办法吗?敬请指教,来者有分。================
using System.IO;string path = @"c:\temp\MyTest.txt";if (File.Exists(path))
{………………}
using System.IO;
if (File.Exists(@"C:\temp\aaa.ini"))
{
}
或
if (File.Exists("C:\\temp\\aaa.ini"))
{
}
{
string str=@"c:\test";
string str1=@"aaa.ini";
//目录是否存在
if(!Directory.Exists(str))
{
return;
}
//文件是否存在
if(File.Exists(str+"\\"+str1))
{
//……
}
}
catch
{
btnReport.Visible=false;
return null;
}
我想再问一个其它问题!
在一个Button点击事件下如何实现自动重新进入该程序?
我这样写:
Application.Exit();
Application.Run();
报错说要用RunDialog()可是我改过来又报错说:RunDialog()受保护级别限制!