作者:cnqing
ScanWriterable.aspx
<%@ Page Language="C#" ValidateRequest="false" %> <%@ Import Namespace="System.IO" %> <%@ Import Namespace="System.Text" %> <!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 runat="server"> <title>ScanWrtieable</title> </head> <body> <script runat="server"> protected void Page_Load(object sender, EventArgs e) { } int cresults; protected void ScanRights(DirectoryInfo cdir) { try { if (Int32.Parse(TextBox_stopat.Text) > 0) { if (cresults > Int32.Parse(TextBox_stopat.Text)) return; } DirectoryInfo[] subdirs = cdir.GetDirectories(); foreach (DirectoryInfo item in subdirs) { ScanRights(item); } if (File.Create(cdir.FullName + "//test").CanWrite) { this.Lb_msg.Text += cdir.FullName+"<br/>"; cresults++; } } catch { } } System.DateTime start = DateTime.Now; protected void ClearAllThread_Click(object sender, EventArgs e) { this.Lb_msg .Text= ""; cresults = 0; ScanRights(new DirectoryInfo(Fport_TextBox.Text)); TimeSpan usetime = System.DateTime.Now - start; this.Lb_msg.Text +="usetime: "+ usetime.TotalSeconds.ToString(); } </script> <form id="form1" runat="server"> <div> start<asp:TextBox ID="Fport_TextBox" runat="server" Text="c:/" Width="60px"></asp:TextBox> Stopat <asp:TextBox ID="TextBox_stopat" runat="server" Text="5" Width="60px"></asp:TextBox>files <asp:Button ID="Button" runat="server" OnClick="ClearAllThread_Click" Text="ScanWriterable" /><br /> <asp:Label ID="Lb_msg" runat="server" Text=""></asp:Label> <br /> </div> <div>code by <a href ="http://www.cncert.net">www.cncert.net</a></div> </form> </body> </html>
下载:http://www.cncert.net/up_files/soft/scanwriterable.aspx.rar
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论