zoukankan      html  css  js  c++  java
  • 2013-1-17 打开/关闭默认共享的命令

    net share d$=d: 可打开d$的默认共享,但权限只有只读

    net share d$=d: /grant:administrator,full 将d$的所有权限赋予administrator用户。

    net share d$ /delete 删除此共享.

    //一般访问

    net use \192.168.125.222h$ aip_pdf "sininavchina6269" /user:"administrator"

    System.Diagnostics.Process pro = new System.Diagnostics.Process();

     pro.StartInfo.FileName = "cmd.exe";            

    pro.StartInfo.UseShellExecute = false;            

    pro.StartInfo.RedirectStandardInput = true;            

    pro.StartInfo.RedirectStandardOutput = true;            

    pro.StartInfo.CreateNoWindow = true;            

    pro.Start();                        

    string cmdline = string.Format(@"net use {0} ""{1}"" /user:""{2}""", path, pass, user).ToLower();            

    pro.StandardInput.WriteLine(cmdline);            

    pro.StandardInput.WriteLine("exit");                        

    // 截取输出流            

    if (tb_output != null)

                {

                    StreamReader reader = pro.StandardOutput;

                    string line = reader.ReadLine();   // 每次读一行

                    while (!reader.EndOfStream)  // 不为空则读取

                    {

                        if (line != "")

                            tb_output.AppendText(line + Environment.NewLine);  // Environment .NewLine 换行

                                            line = reader.ReadLine().Trim();

                        line = line.ToLower();

                        Application.DoEvents();

                    }

                }

                pro.WaitForExit();

                pro.Close();

  • 相关阅读:
    sql存储过程简单教程
    深入揭示Web 2.0核心技术——混搭
    Struts 2创始人Patrick Lightbody看《精通Struts 2:Web 2.0开发实战 》
    深入全面阐释Struts 2的方方面面
    设计原本如此简单
    掌握ASP.NET技术之捷径
    Struts 2创始人Patrick Lightbody作序推荐
    Struts 2权威著作
    Amazon超级畅销书之《C#与.NET 3.5高级程序设计(第4版)》
    Web开发领域最热门的话题之混搭
  • 原文地址:https://www.cnblogs.com/mol1995/p/5965129.html
Copyright © 2011-2022 走看看