两个疑惑的问题
刚开始学asp,好多都不懂,请专家们给点指导,谢谢!
1. 用 JScript 写脚本,变量名是否区分大小写?例如:Server.MapPath 和 server.mappath 是否一样?
2. 我装好 iis 后,用 http://localhost 访问我自定义的首页 mytest.asp,其中有一句
myFile = Server.MapPath("test.txt"); 可以正确执行
但我upload到一个支持asp的免费网站上,网页却显示 http 500 错误,我改为
myFile = server.mappath("verinfo.xml"); 后就可以了
是因为网站有限制,还是因为免费的不稳定?
3. 我想用一个 try ... catch 来捕获上面的错误,所以改为下面的代码:
try
{
myFile = Server.MapPath("test.txt");
}
catch (e1)
{
try
{
myFile = server.mappath("test.txt");
}
catch (e2)
{
}
}
结果同样出现 http 500 错误,即使在我的 localhost 上运行也是这样,错在哪里?