运行WEB程序的我的机器 172.17.136.1 ,网上邻居另一机器172.17.136.2上有一文件c:\a.txt,现在我要在WEB页面程序中检测a.txt是否存在,若存在,则在本机上创建一个temp目录,把a.txt它拷贝过来,怎么写?检测文件是否存在时,我开始时把172.17.136.2\c$映射为网络驱动器Z,又在我的机器的IIS中建一虚拟目录Z,指向网络驱动器Z,但下面写法均不能检测a.txt是否存在,为何?
[C#]
if(System.IO.File.Exists(@"z:\a.txt")) 不行
if(System.IO.File.Exists("http://localhost/z/a.txt")) 也不行若用WebClient,请给出能完成上述任务的具体完整代码.
[C#]
if(System.IO.File.Exists(@"z:\a.txt")) 不行
if(System.IO.File.Exists("http://localhost/z/a.txt")) 也不行若用WebClient,请给出能完成上述任务的具体完整代码.
解决方案 »
- asp.net做网站的迷惑
- 这段代码为什么在ie6下获取不了值呀
- 100分求好看的vs2005.net skin文件
- 关于gridview中嵌套gridview的问题??急~~~~~~~~最后十分了
- 如何在asp.net上弄个自定义播放器啊 核心Windows Media Player 或RealPlayer
- 请各位帮忙解决一下DataBinding:“System.Data.DataRowView”不包含名为“HouseID”的属性。
- (100分)再次救助。。。。。
- 有用过FusionChartsFree的朋友没?有几个问题请教!高分跪求
- Helicon
- 关于iframe
- 如何生数据源生成为.dbf文档。
- 请问哪有asp.net上能够编辑rich text的控件,有源码的最好,没有版权纠纷的。
web.config里配置
<identity impersonate="true"/>
<authentication mode="Windows" />Response.Write(System.IO.File.Exists(◎"z:\photocode.zip"));
和
Response.Write(System.IO.File.Exists(◎"\\192.168.3.106\c$\ttt\photocode.zip"));
都会返回true的
具体你运行asp.net是的什么帐户,请参考
http://www.microsoft.com/taiwan/msdn/books/ataglance/SecNetAP05.htmhttp://www.ccw.com.cn/htm/center/prog/02_9_23_6.asp
<identity impersonate="true"/>
<authentication mode="Windows" />
运行时提示web.config文件有错,为何?
另外也没说怎么拷贝啊
如何在 ASP.NET 应用程序中实现模拟
http://support.microsoft.com/kb/306158/zh-cn