コード例 #1
0
        public static (int, string) ExecuteStorageEmulatorCommand(StorageEmulatorCommand command)
        {
            var emulatorPath = System.IO.Path.Combine(
                Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86),
                "Microsoft SDKs",
                "Azure",
                "Storage Emulator",
                "AzureStorageEmulator.exe");

            StringBuilder sb         = new StringBuilder();
            var           startIInfo = new ProcessStartInfo
            {
                Arguments              = command.ToString(),
                FileName               = emulatorPath,
                UseShellExecute        = false,
                RedirectStandardOutput = true,
            };

            using (var proc = new Process {
                StartInfo = startIInfo
            })
            {
                proc.OutputDataReceived += (sender, e) => sb.Append(e.Data);
                proc.Start();
                proc.BeginOutputReadLine();
                proc.WaitForExit();
                return(proc.ExitCode, sb.ToString());
            }
        }
コード例 #2
0
        public static int ExecuteStorageEmulatorCommand(StorageEmulatorCommand command)
        {
            var start = new ProcessStartInfo
            {
                Arguments = command.ToString(),
                FileName  = @"C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator\AzureStorageEmulator.exe"
            };
            var exitCode = ExecuteProcess(start);

            return(exitCode);
        }
コード例 #3
0
        public static int ExecuteStorageEmulatorCommand(StorageEmulatorCommand command)
        {
            var emulatorPath = System.IO.Path.Combine(
                Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86),
                "Microsoft SDKs",
                "Azure",
                "Storage Emulator",
                "AzureStorageEmulator.exe");

            var start = new ProcessStartInfo
            {
                Arguments = command.ToString(),
                FileName  = emulatorPath
            };
            var exitCode = ExecuteProcess(start);

            return(exitCode);
        }