Click here to Skip to main content
15,897,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
The Bold Mark code is working slow in 64Bit(Windows 2012)....Same code is working fine in 32 bit(Windows 2003)..
Please Help me....




C#
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;
                    }
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900