本文整理汇总了C#中ServerType.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# ServerType.ToString方法的具体用法?C# ServerType.ToString怎么用?C# ServerType.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ServerType
的用法示例。
在下文中一共展示了ServerType.ToString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: setServerType
private void setServerType(ServerType type)
{
Console.WriteLine("...Setting server type to <" + type.ToString() + ">");
ServerTypeInput serverTypeInput = ServerTypeInput.CreateBuilder()
.SetServertype(MapServerType(type)).Build();
ApiInput apiInput = ApiInput.CreateBuilder()
.SetMsgType(ApiInput.Types.MessageType.SERVER_TYPE)
.SetMsgData(serverTypeInput.ToByteString()).Build();
this.send(apiInput);
/*
EzeResult result = null;
while (true)
{
result = this.getResult(this.receive());
if (result.getEventName() == EventName.SET_SERVER_TYPE) break;
}*/
}
示例2: StartSelfHost
private static Process StartSelfHost(ServerType hostType, string applicationPath, string identityDbName)
{
Console.WriteLine(string.Format("Executing klr.exe --appbase {0} \"Microsoft.Framework.ApplicationHost\" {1}", applicationPath, hostType.ToString()));
var startInfo = new ProcessStartInfo
{
FileName = "klr.exe",
Arguments = string.Format("--appbase {0} \"Microsoft.Framework.ApplicationHost\" {1}", applicationPath, hostType.ToString()),
UseShellExecute = true,
CreateNoWindow = true
};
var hostProcess = Process.Start(startInfo);
//Sometimes reading MainModule returns null if called immediately after starting process.
Thread.Sleep(1 * 1000);
try
{
Console.WriteLine("Started {0}. Process Id : {1}", hostProcess.MainModule.FileName, hostProcess.Id);
}
catch (Win32Exception ex)
{
Console.WriteLine("Cannot access 64 bit modules from a 32 bit process");
}
WaitTillDbCreated(identityDbName);
return hostProcess;
}