The following example returns the physical path of the virtual directory that contains the specified Web site.
FilePath = Server.MapPath("MyWebSite");除了这个方法还有别的好方法么?
FilePath = Server.MapPath("MyWebSite");除了这个方法还有别的好方法么?
解决方案 »
- 为什么没有放大缩小的那个工具条
- asp.net 2.0 自定义provider 使用MembershipProvider连接oracle实现登陆页面(很急,在线等)
- 程序在内存中怎么分布的?
- 请高手赐教:一个Excel的问题!!!(分不够可以再加)
- 面试题,怎么输出这样的菱形?
- 为什么我的click事件获取的textBox.Text的值不正确?
- 为什么最后一条记录输不出来?
- 欢迎发表意见,.NET的代码自动生成在实际应用中有用吗
- 如何动态设置模板?
- 从工具箱中放一个DataGrid入Web Forms中,预览时为什么显示不出来?
- 简单问题--datalist如何返回值!!
- 我的命名空间里怎么没有这些数据库组件?
如果 在 http://www.mysite.com/page/subfolder1/subfolder2/1.aspx 中,怎样访问位于站点根目录中的资源?
Dim RawUrl As String = Request.RawUrl
Dim RootUrl As String
RootUrl = Left(AbsUri, Len(AbsUri) - Len(RawUrl)) & Request.ApplicationPath上述最后一行的“ & Request.ApplicationPath”用于虚拟目录
Label2.Text = (string)n.GetValue("/");
记得把后面的数字去掉就搞定了。
<appSettings>
<add key="TreeFile" value="E:\\Admin\\AdminEnd\\XML\\" />
<add key="WebAdminID" value="1" />
</appSettings>在程序中:
ConfigurationSettings.AppSettings["TreeFile"]