|
@ -7,6 +7,30 @@ namespace Utils |
|
|
{ |
|
|
{ |
|
|
public class MemoryHelper |
|
|
public class MemoryHelper |
|
|
{ |
|
|
{ |
|
|
|
|
|
public static string GetMemoryToken() |
|
|
|
|
|
{ |
|
|
|
|
|
string memoryName = string.Empty; |
|
|
|
|
|
string[] args = Environment.GetCommandLineArgs(); |
|
|
|
|
|
foreach (var arg in args) |
|
|
|
|
|
{ |
|
|
|
|
|
if (arg.StartsWith("uid:")) |
|
|
|
|
|
{ |
|
|
|
|
|
memoryName = arg; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var result = MemoryHelper.ReadMMF(memoryName); |
|
|
|
|
|
|
|
|
|
|
|
if (result.isOk) |
|
|
|
|
|
{ |
|
|
|
|
|
return result.content; |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
System.Environment.Exit(0); |
|
|
|
|
|
return string.Empty; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 写入映射文件
|
|
|
/// 写入映射文件
|
|
|