62,046
社区成员
发帖
与我相关
我的任务
分享
<asp:Button ID="Button1" CssClass="input_button" onmouseout="this.className='input_button'" onmouseover="this.className='input_button1'" runat="server" Text="提交"
onclick="Button1_Click" />
css和js文件 跟 html 一样
<asp:Button ID="Button1" runat="server" CssClass="a" Text="Button" onclick="Button1_Click" />
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Response.Write(tt+"s");
this.Button1.Attributes.Add("onmouseover","this.className='a'");
this.Button1.Attributes.Add("onmouseout", "this.className='b'");
}
}
<head runat="server">
<title>无标题页</title>
<style type="text/css">
.a{ background-color:red; width:102px; height:20px; }
.b{ background-color:black; width:102px; height:20px; color:#FFF; }
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<input type="button" id="s" value="s" class="a" onmouseover='this.className="a"' onmouseout='this.className="b"' runat="server" onserverclick="s_Click" />
GetFiles()方法是DirectoryInfo的:
//取得目录
DirectoryInfo di = new DirectoryInfo(目录路径);
//取得文件列表
FileInfo[] fi = di.GetFiles();
//遍历文件
foreach (FileInfo fiTemp in fi)
{
//操作每个文件
}