public SaveRemoteDesktopFile ( string filePath ) : void | ||
filePath | string | |
리턴 | void |
public void Execute() { var properties = new WindowsVirtualMachineProperties() { AdministratorPassword = _applicationFactory.Password, RoleName = _applicationFactory.RoleName, Certificate = _applicationFactory.ManagementCertificate, SubscriptionId = _applicationFactory.SubscriptionId, CloudServiceName = _applicationFactory.CloudServiceName, DeploymentName = _applicationFactory.DeploymentName }; var client = new WindowsVirtualMachineClient(properties); var vm = client.VirtualMachine; System.Console.WriteLine("Virtual machine client"); System.Console.WriteLine("======================"); System.Console.WriteLine("Role name: {0}", vm.RoleName); System.Console.WriteLine("Role size: {0}", vm.RoleSize.ToString()); string rdpFile = Path.Combine(_applicationFactory.PublishSettingsRoot, "vm.rdp"); client.SaveRemoteDesktopFile(rdpFile); System.Console.WriteLine("RDP file saved to: {0}", rdpFile); }
void IBuilder.SpinUp() { var storageClient = new StorageClient(_subscriptionId, _certificate); storageClient.CreateNewStorageAccountIfNotExists(_storageAccountName, _storageLocationName); var client = new WindowsVirtualMachineClient(_subscriptionId, _certificate); var newClient = client.CreateNewVirtualMachineFromTemplateGallery(_properties); Console.WriteLine("Virtual machine now created - with diskname {0}", newClient.VirtualMachine.OSHardDisk.DiskName); Console.WriteLine("Getting and saving RD file"); client.SaveRemoteDesktopFile(_rdpFile); }