先下載此檔案 UNCAccessWithCredentials.cs
使用方式
const string path = @"\\172.16.1.1\aaa";
using (UNCAccessWithCredentials unc = new UNCAccessWithCredentials())
{
unc.NetUseWithCredentials(path, 帳號, 網域, 密碼);
var files = Directory.GetFiles(path).OrderBy(a => new FileInfo(a).CreationTime);
...
沒有留言:
張貼留言