string stdFile = “001.txt”;
string path1= HttpContext.Current.Server.MapPath("test/" + stdFile.ToString());
string Porjectpath = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;//获取或设置包含该应用程序的目录的名称。
string path = Porjectpath + "test\\" +stdFile;
System.IO.FileInfo fie = new FileInfo(path);
if (fie.Exists)
{
String file = path;
FileInfo info = new FileInfo(file);
Process p = new Process();
p.StartInfo.FileName = file;
p.StartInfo.WorkingDirectory = info.DirectoryName;
p.Start();
// System.Diagnostics.Process.Start(path1);
}为什么在我自己的电脑上面可以打开文件 放到服务器上面 这程序就不能打开文件 疑问 没搞懂 请教 请教
string path1= HttpContext.Current.Server.MapPath("test/" + stdFile.ToString());
string Porjectpath = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;//获取或设置包含该应用程序的目录的名称。
string path = Porjectpath + "test\\" +stdFile;
System.IO.FileInfo fie = new FileInfo(path);
if (fie.Exists)
{
String file = path;
FileInfo info = new FileInfo(file);
Process p = new Process();
p.StartInfo.FileName = file;
p.StartInfo.WorkingDirectory = info.DirectoryName;
p.Start();
// System.Diagnostics.Process.Start(path1);
}为什么在我自己的电脑上面可以打开文件 放到服务器上面 这程序就不能打开文件 疑问 没搞懂 请教 请教
解决方案 »
- 文件中的类都不能进行设计,因此未能为该文件显示设计器。设计器检查出文件中有以下类: SysAdmin --- 无法设计基类“zjpis.BasePage”。
- 怎么样实现局域网中文件夹互相传送
- 退出确认保存
- XML数据导入接口(万分火急~~请教高手)
- 急!C#.NET中 RadioButton控件怎末用啊
- 小弟初学.net,高分求问“怎么动态添加treeview中的节点”
- 非常基本的C#,form操作,thx
- 请大家帮忙看看是那里的问题
- 这样用Exception对吗?错在哪里?
- 如何把DataGrid数据导入到Excel中去?
- 如何转换unix时间戳?
- C# .net 问一下在vs2005里的checkBox这个控件
System.IO.FileInfo fie = new FileInfo(path1);Server.MapPath已经是物理路径了
需要()
if (fie.Exists())
直接引用那个路径就OK了吧