“尝试访问已卸载的应用程序域”时出错

时间:2014-07-19 12:39:58

标签: asp.net

internal static ServerMonitoringDetail GetAllServerDetailPVM(string Address, string UserName, string Password, string DatabaseName)
{
    ServerMonitoringDetail objServerMonitoringDetails = new ServerMonitoringDetail();
    try
    {
        ConnectionOptions options =
            new ConnectionOptions();
        options.Username = "Abhijit";
        options.Password = "pass@123";
        options.Impersonation = ImpersonationLevel.Anonymous;
        options.Authority = "Connect";
        options.EnablePrivileges = true;
        options.Timeout = TimeSpan.MaxValue;
        ManagementScope scope =
            new ManagementScope(
            "\\\\Abhijit\\root\\cimv2", options);
        scope.Connect();
        ObjectQuery query = new ObjectQuery(
            "SELECT * FROM Win32_OperatingSystem");
        ManagementObjectSearcher searcher =
            new ManagementObjectSearcher(scope, query);
        ManagementObjectCollection queryCollection = searcher.Get();
        objServerMonitoringDetails.IpAddressMemory = Address;
    }
    catch (Exception ex)
    {
        ApplicationLog.WriteApplicationLog("GetAllServerDetailPVM", "ServerMonitoringDAL", "GetAllServerDetailPVM", "ServerMonitoringTool", "Error Details :-" + ex.Message);
    }
    return objServerMonitoringDetails;
}

0 个答案:

没有答案