Windowsフォームアプリ内のstsadmコマンドを統合する方法
-
09-12-2019 - |
質問
私は「サイトのエクスポート」オプションを持つWindowsフォームアプリケーションを開発しています。stsadmコマンドを実行するようにイベント(C#)。
stsadm.exe -o export -url https://abc20.dev.com/CL / ASDJSA / DEFAULT.ASPX -filename c:\ export.cab -includeUserSecurity -versions 4 -OverWrite
編集これは私のために働いた
.Process exportSite = new Process(); string commonFilesPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.CommonProgramFiles); string commandLine = " -o export -url " + SPContext.Current.Web.Url + " -filename c:\\" + tempName + ".exp -overwrite -includeusersecurity"; exportSite.StartInfo.UseShellExecute = true; exportSite.StartInfo.FileName = commonFilesPath + @"\Microsoft Shared\web server extensions\12\BIN\" + "stsadm.exe "; exportSite.StartInfo.Arguments = commandLine; exportSite.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; exportSite.Start(); exportSite.Close();
解決
私はかなり system.diagnostics.process.start()は、.NETコードからSTSADMを実行できます。