ASP.NET路径问题小结
1.符号“/”指程序运行所在根目录,即IIs所在目录。
如果iis所在目录为:d:\programs
解决方案为d:\programs\d
网站路径为:d:\programs\d\web\
符号“/”代表的是:d:\programs,不管你的网站前面有多少级,都应该作为一个整体。
2.符号“~/”,则是指网站所在根目录。即d:\programs\d\web。
测试代码如下:
protected void Button1_Click(object sender, EventArgs e)
{
Response.Write(Server.MapPath("/"));
Response.Write("<br/>");
Response.Write(Server.MapPath("~/"));
}
输出结果:
C:\inetpub\wwwroot\
D:\Programs2008\WebSite2\
相关文档:
ASP.NET用URL传递中文参数一般会失败,原因是在获取参数之后进行了编译转换。
可能过修改web.config文件让URL正常传递中文参数
在System.web节添加
<globalization requestEncoding="gb2312" responseEncoding="gb2312" culture="zh-CN" fileEncoding="gb2312"/>
即可 ......
Private static readonly object ReflectionLock = new object();
Lock (ReflectionLock)
{
Type scriptManagerType =
Type.GetType(
"System.Web.UI.ScriptManager, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35",
false);
......
asp.net 基于vb。net编程语言 sql数据库
表1 ......
public static void GetHtml(string url,string savepath)//url参数为将要生成的那个动态页面的地址,savepath为要存放地址
{
string Result;
WebResponse MyResponse;
WebRequest MyRequest = System.Net.HttpWebRequest.Create(url);
MyResponse = MyReque ......