public class CheckDesingModel { public static bool IsDesingMode() { bool ReturnFlag = false; if (LicenseManager.UsageMode == LicenseUsageMode.Designtime) ReturnFlag = true; else if (System.Diagnostics.Process.GetCurrentProcess().ProcessName == "devenv") ReturnFlag = true; //if (ReturnFlag) // Msg.Warning("设计模式"); //else Msg.Warning("非设计模式!"); return ReturnFlag; } }
public static bool isDebug(HttpRequestMessage request) { if (request == null) { return System.Diagnostics.Process.GetCurrentProcess().ProcessName == "iisexpress"; } else { string sign = request.Headers.Contains("sign") ? request.Headers.GetValues("sign").FirstOrDefault() : ""; bool result = (System.Diagnostics.Process.GetCurrentProcess().ProcessName == "iisexpress") && (sign == "GarsonZhang2017"); //bool result = sign == "GarsonZhang2017"; return result; } }