我有个函数是上传附件,并返回添加的ID
我有个函数是上传附件,并返回添加的IDpublic bool AddAttachment(ref AttachmentEntity att, FileUpload fileUpload)
{
//上传文件
string attPath = att.PhysicalPath + @"\Attachment"
+ @"\" + DateTime.Now.Year.ToString()
+ @"\" + DateTime.Now.Month.ToString()
+ @"\" + DateTime.Now.Day.ToString();
att.AttachmentURL = @"/" + DateTime.Now.Year.ToString()
+ @"/" + DateTime.Now.Month.ToString()
+ @"/" + DateTime.Now.Day.ToString();
if (Common.CreateDirectory(attPath))
………..}
请问上句中的 + @"\" + 表示什么呀?
我认为 + @"\" 是个变量,对吗? 谢谢
2.
string Script = @"alert('" + pMessage + @"');window.navigate('" + pNavigateTo + @"');";
我感觉这和下面这句是相同的吗
//string Script = ("<script=javascript>alert('"+pMessage+"');window.navigate('"+pNavigateTo+"');</script>");
对吗?
--------------------编程问答-------------------- //string Script = (" <script=javascript> alert('"+pMessage+"');window.navigate('"+pNavigateTo+"'); </script> ");
==========================================
//string Script = (" <script language=javascript> alert('"+pMessage+"');window.navigate('"+pNavigateTo+"'); </script> ");
少写了个language
用这一句啦,把整个脚本全弹出去
上面一句,浏览器是不会知道,你弹出去的是脚本还是语句啦
======================================
@"\"
@是个转义符,意思\就\,而不是系统的符号 --------------------编程问答-------------------- @是个转义符,类似于p处理里的^
补充:.NET技术 , C#