C#共享文件夹的代码片段

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

System.Diagnostics.Process p = new System.Diagnostics.Process();
            p.StartInfo.FileName = "cmd";
            p.StartInfo.Arguments = " /c net share " + shareName + "=" + "\"" + folderName +"\"";
            p.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
            p.StartInfo.CreateNoWindow = true;
            p.StartInfo.UseShellExecute = false;
            p.StartInfo.RedirectStandardOutput = true;              
            p.Start();
            p.WaitForExit();