如果我使用Request.PhysicalApplicationPath,只能读取到当前虚拟目录的物理路径,使用DirectoryEntry对象也未有读取IIS的根目录路径的参数,请问各位大虾如何解决这个问题啊..
解决方案 »
- 请问怎样显示这样的表格
- 一面试题,大虾救命 描述一下三层,ASP和ASP.net的区别,什么是面向对象?面向对象的特点有哪些?如何看待异常、处理异常?异常对程序有社么影响?
- AJAx Web窗体中关闭窗口操作
- 新手提问:asp.net确认对话框的问题
- 求.net 2.0 SQLHelper.cs下载地址
- 高手帮帮忙。
- 滚动条页面刷新保留原位置如何实现?
- 思归老大,孟老大...帮忙呀....有什么方法实现datagrid记录值在两个页面传递)??
- 用DATASET取得数据后如何一条条把记录取出来呢(只要有答都有分数啊)我的可用分全拿出来了,大哥帮帮小第吧
- 我联迪的E520医保刷卡机提示POS未就绪,怎么办?
- 为什么e.Item.BackColor取不到值
- 下面的代码有问题,请帮助解决
DirectoryEntry ent=new DirectoryEntry(entPath, UserName, Password, AuthenticationTypes.Secure);
string a=ent.Properties["Path"].Value
string entPath = String.Format("IIS://{0}/w3svc", "192.168.1.16");
DirectoryEntry ent=new DirectoryEntry(entPath);
string a=ent.Properties["Path"].Value.ToString();出这样的错误信息啊........
Access is denied
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Runtime.InteropServices.COMException: Access is deniedSource Error:
Line 107: string entPath = String.Format("IIS://{0}/w3svc", "192.168.1.16");
Line 108: DirectoryEntry ent=new DirectoryEntry(entPath);
Line 109: string a=ent.Properties["Path"].Value.ToString();
Line 110:
Line 111:
1。 filename="ErrorMessage.txt"; 得到//“C:\WINNT\system32\ErrorMessage.txt”
2。 得到www路径 (/)=(c:\inetpub\wwwroot\)
filename=Server.MapPath("/msg/ErrorMessage.txt"); //c:\inetpub\wwwroot\msg\ErrorMessage.txt
filename=Server.MapPath("/") +"msg/ErrorMessage.txt";
filename=Server.MapPath("../msg/ErrorMessage.txt");
3。 得到当前虚拟根目录的路径 ( ~/)
filename=Server.MapPath("~/msg/ErrorMessage.txt");//D:\公司项目\PowerMis\Web\msg\ErrorMessage.txt
filename=HttpRuntime.AppDomainAppPath;
4. 当前路径(相对)( ./)
filename=Server.MapPath("./ErrorMessage.txt");D:\公司项目\PowerMis\Web\ ErrorMessage.txt
filename=Server.MapPath(Request.ApplicationPath);
filename=Server.MapPath(".");
5 /Web
filename=HttpRuntime.AppDomainAppVirtualPath;
filename=Request.ApplicationPath;