本文整理汇总了C#中Machine.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Machine.ToString方法的具体用法?C# Machine.ToString怎么用?C# Machine.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Machine
的用法示例。
在下文中一共展示了Machine.ToString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ToString
static string ToString(Machine machine) {
switch (machine) {
case Machine.I386: return "x86";
case Machine.AMD64: return "x64";
default: return machine.ToString();
}
}
示例2: GetArchString
/// <summary>
/// Gets the arch as a string
/// </summary>
/// <param name="machine">Machine</param>
/// <returns></returns>
public static string GetArchString(Machine machine) {
switch (machine) {
case Machine.I386: return "x86";
case Machine.AMD64: return "x64";
case Machine.IA64: return "IA-64";
case Machine.ARMNT: return "ARM";
case Machine.ARM64: return "ARM64";
default: return machine.ToString();
}
}
示例3: Introduce
public void Introduce(Machine clientMachine, Machine serverMachine)
{
if (clientMachine == null)
throw new ArgumentNullException("clientMachine");
if (serverMachine == null)
throw new ArgumentNullException("serverMachine");
Trace.WriteLine("Introduced " + clientMachine.ToString() + " to " + serverMachine.ToString());
netPeer.Introduce(clientMachine.PrivateEndPoint, clientMachine.PublicEndPoint, serverMachine.PrivateEndPoint,
serverMachine.PublicEndPoint, String.Empty);
}