Код: Выделить всё
var psi = new System.Diagnostics.ProcessStartInfo()
{
FileName = startPath,
UseShellExecute = true
};
System.Diagnostics.Process.Start(psi);
< /code>
Я хочу сделать что -то похожее для исследования хранения. < /p>
Я попробовал следующее < /p>
var arguments = $"--account-name mystorage --container images --path mysubfolder";
var userDirectory = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
// get the path to the Azure Storage Explorer executable
var workingDirectory = userDirectory+"\\Programs\\Microsoft Azure Storage Explorer";
var fullExeFileName = workingDirectory+"\\StorageExplorer.exe";
if (!Directory.Exists(workingDirectory)) { throw new DirectoryNotFoundException(workingDirectory); }
if (!File.Exists(fullExeFileName)) { throw new FileNotFoundException(fullExeFileName); }
var processStartInfo = new ProcessStartInfo
{
FileName = fullExeFileName,
Arguments = arguements,
UseShellExecute = true,
WorkingDirectory = workingDirectory
};
Process.Start(processStartInfo);
Я открываю прямую ссылку в браузере, но при этом пользователю открывается диалоговое окно, в котором это не то, что я хочу.
Я попробовал командную строку Visual Studio, но не могу заставить аргументы работать.
с командой
Код: Выделить всё
storageexplorer "--account-name mystorage"
< /code>
Следующий файл журнала генерируется
[2025-01-26T22:15:40.815Z] (main:17928) Log level: info [2025-01-26T22:15:40.815Z] (main:17928) Startup app state: { lastWindowState: { rect: { x: 900, y: 652, width: 1760, height: 902 }, maximized: false } } [2025-01-26T22:15:40.907Z] (main:17928) Calling handleQuitOrRelaunch from quit [2025-01-26T22:15:40.907Z] (main:17928) Quitting, sessionEnded: false, force: true, quitOrRelaunch: quit [2025-01-26T22:15:40.907Z] (main:17928) Error occurred while trying to actually quit: {} [2025-01-26T22:15:40.908Z] (main:17928) Calling quit, bye! Подробнее здесь: https://stackoverflow.com/questions/793 ... amatically
Мобильная версия