急求!!!!!!!!!!如何判断一个指定文件是否存在!!!!!!!在线等待!!! 在c#代码中,如何实现判断一个指定文件file(注:我可以判断是否存在指定文件夹),是否存在????????????? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 文件:System.IO.FileInfo文件夹:System.IO.Directory if( System.Io.File.Exits(文件路径及文件名) ){ //存在}else{ //不存在} System.IO.File.Exists(string path) //库自带函数 确定指定的文件是否存在 返回值(bool型),true为存在,false为否 if(System.IO.File.Exists(System.IO.Directory.GetCurrentDirectory() + @"\PLN_Config.ini")) { System.Text.StringBuilder AnnounceTime = new System.Text.StringBuilder(1024); GetPrivateProfileString("initTime","AnnounceTime","error",AnnounceTime,AnnounceTime.MaxCapacity,System.IO.Directory.GetCurrentDirectory()+@"\Config.ini"); this.ultraCalendarCombo1.Value = System.DateTime.Parse(AnnounceTime.ToString())+new System.TimeSpan(0,0,1,0,0); } 贴多了,这一句就可以了.if(System.IO.File.Exists(System.IO.Directory.GetCurrentDirectory() + @"\PLN_Config.ini")){} PivotGridControl控件修改行名列名问题 各位老师来帮帮忙! bdmh caozhy lxcnn 如何实现图片加密,只能通过系统浏览图片? C#中怎樣將mail附件的Excel文檔的內容添加到正文裡 c# FastReport.Net 本地化 截取字符串 asp.net 弱弱的问一下,2005里面怎么建ASP.NET Web的应用程序啊?2003里直接有这个 跪求SerialPort写的短信收发实例。。。 VB里WebBrowser1.Document.body.bgcolor = "#ff6633" 关于winfrom窗体的问题。 nant问题
文件夹:System.IO.Directory
{
//存在
}
else
{
//不存在
}
{
System.Text.StringBuilder AnnounceTime = new System.Text.StringBuilder(1024);
GetPrivateProfileString("initTime","AnnounceTime","error",AnnounceTime,AnnounceTime.MaxCapacity,System.IO.Directory.GetCurrentDirectory()+@"\Config.ini");
this.ultraCalendarCombo1.Value = System.DateTime.Parse(AnnounceTime.ToString())+new System.TimeSpan(0,0,1,0,0);
}
if(System.IO.File.Exists(System.IO.Directory.GetCurrentDirectory() + @"\PLN_Config.ini"))
{
}