Я могу дать своему пользователю хороший опыт открытия исследователя файлов Windows со следующим кодом. < /p>
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);
< /code>
, который открывает StorageExplorer, но не в соответствующей подпапке. Я не хочу.
storageexplorer "--account-name mystorage"
< /code>
Сгенерируется следующий файл журнала: < /p>
[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
Как открыть Azure Storage Explorer на определенной подпапке программно? ⇐ C#
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение