資源簡介
代碼實(shí)現(xiàn)創(chuàng)建共享文件夾,其他連接電腦具有所有權(quán)限
調(diào)用方法: ShareHelper.Fun_NetShare("SensorCode","C:\\SensorCode");具體調(diào)用方式就可以了
代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.Linq;
using?System.Text;
using?System.Threading.Tasks;
using?System.Management;
using?System.Collections;
using?System.Diagnostics;
using?System.IO;
namespace?Autoframe
{
????public?class?ShareHelper
????{
????????//???ShareHelper.Fun_NetShare(“SensorCode““C:\\SensorCode“);具體調(diào)用方式就可以了?
????????public?static?void?Fun_NetShare(string?strshareName?string?folderpath?int?milliseconds?=?2000)
????????{
????????????if?(!Directory.Exists(folderpath))
????????????{
????????????????Directory.CreateDirectory(folderpath);
????????????}
????????????if?(!string.IsNullOrEmpty(strshareName))
????????????{
????????????????Process?process?=?new?Process();?????//創(chuàng)建進(jìn)程對象
????????????????ProcessStartInfo?startInfo?=?new?Pr
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件????????2162??2020-05-19?17:54??ShareHelper.cs
評論
共有 條評論