• 共享目录


     1     public static class ShareFolder
     2     {
     3         /// <summary>
     4         /// 自动为用户创建及设置共享目录,以方便用户。
     5         /// </summary>
     6         public static void SetShareFolder()
     7         {
     8             const string shareFolderPath = @"C:SMLShareFolder";
     9 
    10             string proFolderPath = Path.Combine(shareFolderPath, "PRO");
    11 
    12             if (!Directory.Exists(shareFolderPath))
    13             {
    14                 Directory.CreateDirectory(shareFolderPath);
    15             }
    16 
    17             if (!Directory.Exists(proFolderPath))
    18             {
    19                 Directory.CreateDirectory(proFolderPath);
    20             }
    21 
    22             string args = string.Format(@"net share FlexiPrintShareFolder={0} /grant:everyone,full", shareFolderPath);
    23          
    24             var psi = new ProcessStartInfo("netsh", args);
    25             psi.UseShellExecute = true;
    26             psi.Verb = "runas";
    27             psi.CreateNoWindow = true;
    28             psi.WindowStyle = ProcessWindowStyle.Hidden;
    29             psi.UseShellExecute = true;
    30             Process.Start(psi).WaitForExit();
    31         }
    32     }
  • 相关阅读:
    python module introduce
    python代码基
    20100911部署更新
    汉王ocr
    wsgi
    css布局模板
    Making a simple web server in Python.
    20100910更新部署
    tw.forms usage
    python web shell
  • 原文地址:https://www.cnblogs.com/JustYong/p/5740325.html
Copyright © 2020-2023  润新知