@在c#中为强制不转义 的符号,在里面的转义字符无效
string str1 = "abc\n"; // 这里\n当然默认转为换行符
string str2 = @"abc\n" // 这里\n不自动转为换行符号,相当于 str2 = "abc\\n"
以下两种方式等效
string aaa="D:\\Root\\SendEmail\\SendEmail\\bin\\Debug\\downjmail.dll";
string aaa=@"D:\Root\SendEmail\SendEmail\bin\Debug\downjmail.dll";
通过使用后一种方法得到的字符串还可以横跨多行而不需要使用’\n’。使用这种方法唯一需要使用到转义序列的字符串是”,其转义字符为””(两个连在一起的双引号)。例如想将the word "big" contains three letters.赋值给’text’,我们就可以使用如下的语句:string text = @"the word ""big"" contains three letters."。
补:textBox中换行必须是"\r\n",其他的"\r" 或 "\n" 或 "\n\r" 都会显示成小方框,其他控件未试。
Server.MapPath的用法 ./当前目录
/根目录
../上层目录(相对当前来说)
如果当前的网站目录为D:\wwwroot 浏览的页面路径为D:\wwwroot\company\news\show.asp
在show.asp页面中使用
Server.MapPath("./") 返回路径为:D:\wwwroot\company\news
Server.MapPath("/") 返回路径为:D:\wwwroot
Server.MapPath("../") 返回路径为:D:\wwwroot\company
server.MapPath(request.ServerVariables("Path_Info"))
Request.ServerVariables("Path_Translated")
上面两种方式返回路径为 D:\wwwroot\company\news\show.asp