<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      刪除共享文件夾的一小段程序

      這幾天在局域網里面總是中毒,共享文件夾里面給人加入了許多熊貓,將共享文件夾刪掉吧。寫了個寫程序完成這個功能

      using System;
      using System.Drawing;
      using System.Collections;
      using System.ComponentModel;
      using System.Windows.Forms;
      using System.Data;
      using System.IO;
      using System.Diagnostics;

      namespace ShareKiller
      {
          
      /// <summary>
          
      /// Form1 的摘要說明。
          
      /// </summary>
          
      /// 


          
          
      public class Form1 : System.Windows.Forms.Form
          
      {
              
      private System.Windows.Forms.Button button1;
              
      private System.Windows.Forms.ListView listView1;
              
      private System.Windows.Forms.ColumnHeader columnHeader1;
              
      private System.Windows.Forms.ColumnHeader columnHeader2;
              
      private System.Windows.Forms.ColumnHeader columnHeader3;
              
      /// <summary>
              
      /// 必需的設計器變量。
              
      /// </summary>

              private System.ComponentModel.Container components = null;

              
      public Form1()
              
      {
                  
      //
                  
      // Windows 窗體設計器支持所必需的
                  
      //
                  InitializeComponent();

                  
      //
                  
      // TODO: 在 InitializeComponent 調用后添加任何構造函數代碼
                  
      //
              }


              
      /// <summary>
              
      /// 清理所有正在使用的資源。
              
      /// </summary>

              protected override void Dispose( bool disposing )
              
      {
                  
      if( disposing )
                  
      {
                      
      if (components != null
                      
      {
                          components.Dispose();
                      }

                  }

                  
      base.Dispose( disposing );
              }


              
      Windows 窗體設計器生成的代碼

              
      /// <summary>
              
      /// 應用程序的主入口點。
              
      /// </summary>

              [STAThread]
              
      static void Main() 
              
      {
                  Application.Run(
      new Form1());
              }

              

              
      public static ArrayList GetShareFiles()
              
      {
                  Process   p   
      =   new   Process();   
          
                  p.StartInfo.FileName   
      =   "cmd.exe";   
          
                  p.StartInfo.UseShellExecute   
      =   false;   
          
                  p.StartInfo.RedirectStandardInput   
      =   true;   
          
                  p.StartInfo.RedirectStandardOutput   
      =   true;   
          
                  p.StartInfo.RedirectStandardError   
      =   true;   
          
                  p.StartInfo.CreateNoWindow   
      =   true;      
                  p.Start();   
                  
      string cmdText="net share";
                  p.StandardInput.WriteLine(cmdText);   
          
                  p.StandardInput.WriteLine(
      "exit");       
                  
      string   strRst   =   p.StandardOutput.ReadToEnd();   
                  p.Close();  
                  ArrayList list 
      = new ArrayList();
                  
      if(strRst.IndexOf("命令成功完成")!=-1)
                  
      {
                      
      //成功
                      string ss="-------------------------------------------------------------------------------";
                      
      int index1 = strRst.IndexOf(ss)+ss.Length;
                      ss
      ="命令成功完成";
                      
      int index2 = strRst.IndexOf(ss);
                      strRst 
      = strRst.Substring(index1,index2-index1);
                      
      string[] items = System.Text.RegularExpressions.Regex.Split(strRst,"\r\n",System.Text.RegularExpressions.RegexOptions.IgnoreCase);
                      
      foreach(string it in items)
                      
      {
                          
      if(it!="")
                          
      {
                              
      string[] sss  = it.Split(' ');
                              
      int i=0;
                                  ShareInfo si 
      = new ShareInfo();
                              
      foreach(string s in sss)
                              
      {        
                              
                                  
      if(s!="")
                                  
      {                                
                                      
      if(i==0)
                                      
      {

                                          si.Name
      =s;
                                      }

                                      
      else if(i==1)
                                      
      {
                                          si.Resource
      =s;
                                      }

                                      
      else if(i==2)
                                      
      {
                                          si.Note 
      = s;
                                          
      break;
                                      }

                                      
                                      i
      ++;
                                  }

                              }
      list.Add(si);
                          }

                      }
                      
                  }

                  
      return list;
              }

              
      public static void Excute(string cmdText)
              
      {
                  Process   p   
      =   new   Process();   
          
                  p.StartInfo.FileName   
      =   "cmd.exe";   
          
                  p.StartInfo.UseShellExecute   
      =   false;   
          
                  p.StartInfo.RedirectStandardInput   
      =   true;   
          
                  p.StartInfo.RedirectStandardOutput   
      =   true;   
          
                  p.StartInfo.RedirectStandardError   
      =   true;   
          
                  p.StartInfo.CreateNoWindow   
      =   true;      
                  p.Start();             
                  p.StandardInput.WriteLine(cmdText);       
                  p.StandardInput.WriteLine(
      "exit");     
                  
      while(!p.HasExited)
                  
      {
                      p.WaitForExit();
                  }

                  p.Close();      
              }


              
      void BindData()
              
      {
                  ArrayList list 
      = GetShareFiles(); 
                  listView1.Items.Clear();
                  
      foreach(ShareInfo si  in list)
                  
      {
                      ListViewItem item 
      = new ListViewItem(new string[]{si.Name,si.Resource,si.Note});
                      listView1.Items.Add(item);
                  }

              }

              
      private void Form1_Load(object sender, System.EventArgs e)
              
      {
                 BindData();
              }


              
      private void button1_Click(object sender, System.EventArgs e)
              
      {
                  
      foreach(ListViewItem item in listView1.Items)
                  
      {
                      
      if(item.Selected)
                      
      {
                          
      string cmdText = "net share "+item.Text+" /delete";
                          Excute(cmdText);
                      }

                  }

                  BindData();
              }

          }

          
      public class ShareInfo
          
      {
              
      public string Name;
              
      public string Resource;
              
      public string Note;
          }

      }

      posted @ 2007-02-08 13:17  Robin Zhang  閱讀(1469)  評論(1)    收藏  舉報
      主站蜘蛛池模板: 精品国产欧美一区二区五十路| 国产不卡在线一区二区| 日韩精品 在线一区二区| 日韩成人精品一区二区三区| 国产成人亚洲欧美二区综合| 国产精品国三级国产专区| 国产一区一一区高清不卡| 中文在线最新版天堂| 日本道不卡一二三区视频| 四虎库影成人在线播放| 无码精品人妻一区二区三区湄公河| 国产高清无遮挡内容丰富| 加勒比色综合久久久久久久久 | 亚洲www永久成人网站| 中文字幕在线日韩一区| 国产精品久久久久aaaa| 午夜国产理论大片高清| 国产日韩精品免费二三氏| 亚洲中文字幕日产无码成人片| 亚洲熟妇无码爱v在线观看 | 少妇被多人c夜夜爽爽av| 亚洲国产欧美一区二区好看电影| 天美传媒一区二区| 深夜宅男福利免费在线观看| 综合欧美视频一区二区三区| 国产精品无码无片在线观看3d| 亚欧乱色精品免费观看| 欧美一性一乱一交一视频| 91久久夜色精品国产网站| 漂亮的保姆hd完整版免费韩国| 国产精品视频一区二区噜| 国产99久久亚洲综合精品西瓜tv| 在线精品自拍亚洲第一区| 无码日韩av一区二区三区| 精品无码国产污污污免费| 久久99精品久久久大学生| xbox免费观看高清视频的软件| 亚洲 日本 欧洲 欧美 视频| 亚洲偷偷自拍码高清视频| 久久精品蜜芽亚洲国产AV| 国产中文成人精品久久久|