这是后台代码
代码
using System;
using SystemCollections;
using SystemConfiguration;
using SystemData;
using SystemLinq;
using SystemWeb;
using SystemWebSecurity;
using SystemWebUI;
using SystemWebUIHtmlControls;
using SystemWebUIWebControls;
using SystemWebUIWebControlsWebParts;
using SystemXmlLinq;
using SystemText;
using SystemTextRegularExpressions;
namespace WebApplication {
public partial class _Default : SystemWebUIPage {
protected void Page_Load(object sender EventArgs e) {
String str = <a href=\{&a>\>{&a }<a>{&bbbbccccc };
String b = cleanStr(str);
string c = str(str);
thisLabelText = c;
}
public string cleanStr(String str) {
StringBuilder bs = new StringBuilder(str);
string str = strSubstring( strLength );
str = strTrim();
return str;
}
public string str(string str) {
int i = ;
int i = ;
string str_ = ;
string str = ;
string str = ;
Boolean bl = false;
Boolean bl = true;
for (int i = ; i < strLength; i++) {
if (str[i] == { && str[i + ] == &) {
i = i;
bl = true;
bl = false;
}
if (bl) {
str_ += str[i];
}
if (str[i] == } && bl) {
i = i;
str = strSubstring(i (i i) + );// +;
str = strSubstring( strLength );
str = strTrim();
str = html_str(str);
str_ += str;
bl = false;
bl = true;
}
}
return str_;
}
public string html_str(string str) {
if (str == a) {
return html_str({&b});
}
if (str == b) {
return html_str({&c});
}
if (str == c) {
return html_str(进入qq);
}
return null;
}
public string html_str(string str) {
Regex r = new Regex(@{+&+[AZaz]+});
if (rIsMatch(str)) {
return str(str);
}
return str;
}
}
}
前台代码
代码
<%@ Page Language=C# AutoEventWireup=true CodeBehind=Defaultaspxcs Inherits=WebApplication_Default %>
<!DOCTYPE html PUBLIC //WC//DTD XHTML Transitional//EN transitionaldtd>
<html xmlns= >
<head id=Head runat=server>
<title>Untitled Page</title>
</head>
<body>
<form id=form runat=server>
<div>
<asp:Label ID=Label runat=server></asp:Label>
</div>
</form>
</body>
</html>
运行结果
src=http://imgeducitycn/img_///png>