在ASP.NET里怎么判断一个文件是否存在?用网络路径,C#
解决方案 »
- asp.net网站,现在要做5国语言?是放在一个项目里复制5个国家语言的页面,用一个库建5种表哪, 还是再重新拉4个项目,建4sql数据库?
- iframe内容正在加载,请各位帮忙
- 在触发器中可否对其他数据库进行操作?
- 请问现在asp.net 用哪种界面控件比较好,类似于devexpress之类,大家说一下谢谢
- 求助DataGrid合并列
- 问个问题 怎么在asp.net下实现像DW那样的框架页面?
- 问题问题:C#如何获取屏幕颜色值??????急!!谢谢!!
- 我的IE为什么无法显示.net控间呢,急!急!急!
- 有关EXCEL和SQL~~在线~~
- 手机访问asp.net网页 input获得焦点调用英文键盘
- 如何获取当月,当年最后一天的日期?
- 救命啊!!!!!1大哥们帮我翻译一下这句代码吧!!!!!1
File.Exists(Server.MapPath("../xx.txt"))
if(!dirinfo.Exists)
{
System.IO.Directory.CreateDirectory(Server.MapPath("backupdata"));
}
else
{
if(System.IO.File.Exists(Server.MapPath("backupdata/data.dat")))
{
string strcnn=System.Configuration.ConfigurationSettings.AppSettings["strcnn"];
SqlConnection cnn=new SqlConnection(strcnn);
SqlCommand cmd=new SqlCommand("admindata1",cnn);
cmd.CommandType=CommandType.StoredProcedure;
try
{
cnn.Open();
cmd.ExecuteNonQuery();
cmd.Dispose();
}
catch(Exception E)
{
Response.Write(E.Message);
}
finally
{
cnn.Close();
cnn.Dispose();
}
看看这个类[C#]
// Create a new WebClient instance.
WebClient myWebClient = new WebClient();
// Download home page data.
Console.WriteLine("Accessing {0} ...", uriString);
// Open a stream to point to the data stream coming from the Web resource.
Stream myStream = myWebClient.OpenRead(uriString);Console.WriteLine("\nDisplaying Data :\n");
StreamReader sr = new StreamReader(myStream);
Console.WriteLine(sr.ReadToEnd());
// Close the stream.
myStream.Close();