在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
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; } }
|
请发表评论