百度空间 | 百度首页 
               
 
查看文章
 
扫权限.aspx
2008-10-09 21:06
  1. <%@ Page Language="C#" ValidateRequest="false" %>
  2. <%@ Import Namespace="System.IO" %>
  3. <%@ Import Namespace="System.Text" %>
  4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  5. <html xmlns="http://www.w3.org/1999/xhtml">
  6. <head runat="server">
  7.      <title>ScanWrtieable</title>
  8. </head>
  9. <body>
  10.      <script runat="server">
  11.     
  12.         protected void Page_Load(object sender, EventArgs e)
  13.          {
  14.          }
  15.         int cresults;
  16.         protected void ScanRights(DirectoryInfo cdir)
  17.          {
  18.              try
  19.               {
  20.                  if (Int32.Parse(TextBox_stopat.Text) > 0)
  21.                   {
  22.                      if (cresults > Int32.Parse(TextBox_stopat.Text))
  23.                          return;
  24.                   }
  25.                  DirectoryInfo[] subdirs = cdir.GetDirectories();
  26.                 foreach (DirectoryInfo item in subdirs)
  27.                  {
  28.                      ScanRights(item);
  29.                  }
  30.                  
  31.                    File.Create(cdir.FullName + "\\test").Close();
  32.                
  33.                     this.Lb_msg.Text += cdir.FullName+"<br/>";
  34.                      cresults++;
  35.                      File.Delete(cdir.FullName + "\\test");
  36.                 
  37.               }
  38.              catch { }
  39.          }
  40.          System.DateTime start = DateTime.Now;
  41.         protected void ClearAllThread_Click(object sender, EventArgs e)
  42.          {
  43.             this.Lb_msg .Text= "";
  44.              cresults = 0;
  45.              ScanRights(new DirectoryInfo(Fport_TextBox.Text));
  46.              TimeSpan usetime = System.DateTime.Now - start;
  47.             this.Lb_msg.Text +="usetime: "+ usetime.TotalSeconds.ToString();
  48.          }
  49.         
  50.      </script>
  51.      <form id="form1" runat="server">
  52.    
  53.      <div>
  54.           start<asp:TextBox ID="Fport_TextBox" runat="server" Text="c:\" Width="60px"></asp:TextBox>   
  55.           Stopat <asp:TextBox ID="TextBox_stopat" runat="server" Text="5" Width="60px"></asp:TextBox>files
  56.          <asp:Button ID="Button" runat="server" OnClick="ClearAllThread_Click" Text="ScanWriterable" /><br />
  57.          <asp:Label ID="Lb_msg" runat="server" Text=""></asp:Label>
  58.          <br />
  59.           </div>
  60.           <div>code by <a href ="http://www.cncert.net">www.cncert.net</a></div>
  61.      </form>
  62. </body>
  63. </html>

下载:http://www.cncert.net/up_files/soft/scanwriterable.aspx.rar

类别:木瓜 | 添加到搜藏 | 浏览() | 评论 (0)
 
最近读者:
 
网友评论:
发表评论:
姓 名:
网址或邮箱: (选填)
内 容:
验证码: 请点击后输入四位验证码,字母不区分大小写
      

     

©2009 Baidu