代码
using System
using System Collections
using System Configuration
using System Data
using System Linq
using System Web
using System Web Security
using System Web UI
using System Web UI HtmlControls
using System Web UI WebControls
using System Web UI WebControls WebParts
using System Xml Linq
using System Text
using System Text RegularExpressions
namespace WebApplication {
public partial class _Default : System Web UI Page {
protected void Page_Load(object sender EventArgs e) {
String str = <a href=\ {&a >\ >{&a }<a>{&bbbbccccc }
String b = cleanStr(str)
string c = str (str)
this Label Text = c
}
public string cleanStr(String str) {
StringBuilder bs = new StringBuilder(str)
string str = str Substring( str Length )
str = str Trim()
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 <str Lengthi++) {
if (str[i] == { &&str[i + ] == &) {
i = i
bl = true
bl = false
}
if (bl ) {
str_ += str[i]
}
if (str[i] == } &&bl ) {
i = i
str = str Substring(i (i i ) + )// +
str = str Substring( str Length )
str = str Trim()
str = _str(str )
str_ += str
bl = false
bl = true
}
}
return str_
}
public string _str(string str) {
if (str == a ) {
return _str ( {&b} )
}
if (str == b ) {
return _str ( {&c} )
}
if (str == c ) {
return _str ( 进入qq )
}
return null
}
public string _str (string str) {
Regex r = new Regex(@ {+&+[A Za z ]+} )
if (r IsMatch(str)) {
return str (str)
}
return str
}
}
}
前台代码
代码
<%@ Page Language= C# AutoEventWireup= true CodeBehind= Default aspx cs Inherits= WebApplication _Default %>
<!DOCTYPE PUBLIC //W C//DTD XHTML Transitional//EN transitional dtd >
<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>
</>
运行结果
lishixinzhi/Article/program/net/201311/11752input
position:relative
span
position:absolute//span相对于input的绝对定位
left:(input长度)
top:0
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
function selChange(){
var sel=document.getElementById('sel')
alert(sel.options[sel.selectedIndex].text)
alert(sel.options[sel.selectedIndex].value)
}
</script>
</head>
<body>
<select id="sel" onchange="selChange()" >
<option value="zhangsan">张三</option>
<option value="lisi" >李四</option>
<option value="wangwu" >王五</option>
</select>
</body>
</html>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)