私は、asp.net mvc3 で、展開ファイルをローカル ドライブからウィンドウ サーバー 2008 R2 サーバーの共有ドライブにコピーする小さなプロジェクトに取り組んでいます。WMI を使用して接続していますが、接続は成功しています。しかし、フォルダーを作成しようとすると、「ログオンに失敗しました: 不明なユーザー名またはパスワードが正しくありません」というメッセージが表示されます。サンプルコードは次のとおりです。
bool isConnected = false;
options.Username = user.Name.Trim();
options.Password = user.password.Trim();
mScope = new ManagementScope("\\\\xxx.xxx.xxx.xxx\\root\\cimv2", options);
mScope.Connect();
if (mScope.IsConnected == true)
{
//I've gotten to this point. Then, the code below throw the exception
Directory.CreateDirectory(@"\\\\xxx.xxx.xxx.xxx\Tester\shareFile.txt");
isConnected = true;
}
私は何をしているのか知りたいですか?それは正しい方法ですか?