foreach (ManagementObject Mo in moReturn) { field = Mo["Name"].ToString().Split(("_").ToCharArray()); //StrPortName = field[field.Length - 1]; if (bPortHang == false) { StrPortName = field[field.Length - 1]; } else { StrPortName = Convert.ToString(Convert.ToInt16(StrPortName) + 1); bPortHang = false; } System.Diagnostics.EventLog.WriteEntry("Depth Distributor", "Completed Stage23_1 " + StrPortName + System.DateTime.Now.ToString(), System.Diagnostics.EventLogEntryType.FailureAudit); objSession_Info = (IDepth.ISession_Info)Activator.GetObject(typeof(IDepth.ISession_Info), "tcp://localhost:" + StrPortName.Trim() + "/Session_Info"); System.Diagnostics.EventLog.WriteEntry("Depth Distributor", "Completed Stage23_2 " + StrPortName + System.DateTime.Now.ToString(), System.Diagnostics.EventLogEntryType.FailureAudit); int iCurrentUserPerPort = objSession_Info.CurrentUser; //Checking For the Maxmimum Per Port //Else Create New Port if (iCurrentUserPerPort >= MaxUser) { sReturnPortNO = ""; continue; } else { sReturnPortNO = StrPortName; return sReturnPortNO; } iPortCounter = iPortCounter + 1; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)