62,254
社区成员
发帖
与我相关
我的任务
分享
public class TestClass
{
string path = HttpContext.Current.Server.MapPath(@"~/Bin")+@"\";
public string Test()
{
if(!path.Contains(@"/") && !path.Contains(@"\") )
{
throw new Exception("路径出现异常!异常路径为:"+path);
}
}
}
try
{
TestClass _tc = new TestClass ();
_tc.Test();
}catch(Exception e)
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "loadactive", "<script>alert('" + ex.Message + "');</script>");
}