示例#1
0
        public static string  GetIP4Address()
        {
            string IP4Address = String.Empty;

            try
            {
                foreach (IPAddress IPA in Dns.GetHostAddresses(System.Net.Dns.GetHostName()))
                {
                    if (IPA.AddressFamily.ToString() == "InterNetwork")
                    {
                        IP4Address = IPA.ToString();
                        break;
                    }
                }
                return(IP4Address);
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "GetIP4Address", "ClsBuddy.cs");
                return(IP4Address);
            }
        }
示例#2
0
        public static int Consultar(ActualizacionPAModel[] models, SessionDB sesion)
        {
            int           agregados = 0;
            List <string> listIDSIU = new List <string>();

            if (models.Length > 0)
            {
                bool TMP = true;
                foreach (ActualizacionPAModel model in models)
                {
                    if (model.IDSIU == "00260600")
                    {
                        model.IDSIU = model.IDSIU;
                    }
                    model.sesion = sesion;

                    IPersona persona = model as IPersona;
                    persona.findPersona();
                    model.PERSONA_REGISTRADA = model.PK_PERSONA != -1 ? "1" : "0";

                    if (listIDSIU.Contains(model.IDSIU) || persona.addPersona(TMP))
                    {
                        IPA pa = model as IPA;
                        pa.findPA();
                        model.PA_REGISTRADA = model.PK_PA != -1 ? "1" : "0";

                        if (pa.addPA(TMP))
                        {
                            agregados++;
                            listIDSIU.Add(model.IDSIU);
                            continue;
                        }
                    }
                    break;
                }
            }
            return(agregados);
        }
示例#3
0
        static void Main(string[] args)
        {
            var bmw = new Modern("BMW", "R1150-RT", 2005);

            var honda = new Vintage("Honda", "Nighthawk 700SC", 1986);

            var grassroots = new IPA("Calfkiller", "Grassroots", 5.7, "unknown");

            var getUpGetDown = new Stout("Wiseacre", "Gotta Get Up To Get Down", 5, true);

            var elijah = new Bourbon("Elijah Craig", "Small Batch", "94", "Kentucky");

            var balcones = new Bourbon("Balcones", "True Blue", "100", "Texas");

            var sarah = new Female("Sarah", "Silverman", "Jesus Is Magic");

            var cross = new Male("David", "Cross", "Mr. Show");


            Console.WriteLine("These are my current favorite motorcycles:");
            Console.WriteLine(bmw.Year + " " + bmw.Make + " " + bmw.Model);
            Console.WriteLine(honda.Year + " " + honda.Make + " " + honda.Model);
            Console.WriteLine("");
            Console.WriteLine("These are some of my favorite beers:");
            Console.WriteLine(grassroots.Brand + " " + grassroots.Name + " is " + grassroots.Abv + "%");
            Console.WriteLine(getUpGetDown.Brand + " " + getUpGetDown.Name + " is a " + getUpGetDown.Abv + "%");
            Console.WriteLine("");
            Console.WriteLine("These are some of my favorite whiskeys:");
            Console.WriteLine(elijah.Brand + " " + elijah.Name + " is " + elijah.Proof + " proof");
            Console.WriteLine(balcones.Brand + " " + balcones.Name + " is " + balcones.Proof + " proof");
            Console.WriteLine("");
            Console.WriteLine("These are some of my favorite comedians:");
            Console.WriteLine(sarah.FirstName + " " + sarah.LastName + " was awesome in '" + sarah.BestWork + "'");
            Console.WriteLine(cross.FirstName + " " + cross.LastName + " was awesome in '" + cross.BestWork + "'");

            Console.ReadKey();
        }
        //This function gets the IP Address
        public static string GetIP4Address()
        {
            //Initializes the variable and sets it to empty
            string IP4Address = string.Empty;

            //loop that will get the IP
            foreach (IPAddress IPA in Dns.GetHostAddresses(HttpContext.Current.Request.UserHostAddress))
            {
                if (IPA.AddressFamily.ToString() == "InterNetwork")
                {
                    //Sets the IP address to the Variable
                    IP4Address = IPA.ToString();
                    //Removes from loop
                    break;
                }
            }
            //If the IP is not empty then it will return the IP address otherwise it wull try to find it
            if (IP4Address != string.Empty)
            {
                //Returns the IP address
                return(IP4Address);
            }
            //Loop to grab the Host Address
            foreach (IPAddress IPA in Dns.GetHostAddresses(Dns.GetHostName()))
            {
                //Finds and returns Host
                if (IPA.AddressFamily.ToString() == "InterNetwork")
                {
                    //Sets variable to the IP address
                    IP4Address = IPA.ToString();
                    //Removes from the loop
                    break;
                }
            }
            //Returns the IP address
            return(IP4Address);
        }
示例#5
0
        /// <summary>
        /// 获取客户端IP。
        /// </summary>
        /// <param name="address"></param>
        /// <returns></returns>
        public static string GetIP4Address(string address)
        {
            string IP4Address = String.Empty;

            if (address == "::1")
            {
                foreach (IPAddress IPA in Dns.GetHostAddresses(address))
                {
                    if (IPA.AddressFamily.ToString() == "InterNetwork")
                    {
                        IP4Address = IPA.ToString();
                        break;
                    }
                }

                if (IP4Address != String.Empty)
                {
                    return(IP4Address);
                }

                foreach (IPAddress IPA in Dns.GetHostAddresses(Dns.GetHostName()))
                {
                    if (IPA.AddressFamily.ToString() == "InterNetwork")
                    {
                        IP4Address = IPA.ToString();
                        break;
                    }
                }
            }
            else
            {
                IP4Address = address;
            }

            return(IP4Address);
        }
示例#6
0
        static public string GetIP4Address(HttpRequest iHttpRequestContext)
        {
            try
            {
                string IP4Address = String.Empty;

                foreach (IPAddress IPA in Dns.GetHostAddresses(iHttpRequestContext.UserHostAddress))
                {
                    if (IPA.AddressFamily.ToString() == "InterNetwork")
                    {
                        IP4Address = IPA.ToString();
                        break;
                    }
                }

                if (IP4Address != String.Empty)
                {
                    return(IP4Address);
                }

                foreach (IPAddress IPA in Dns.GetHostAddresses(Dns.GetHostName()))
                {
                    if (IPA.AddressFamily.ToString() == "InterNetwork")
                    {
                        IP4Address = IPA.ToString();
                        break;
                    }
                }

                return(IP4Address);
            }
            catch
            {
                return(iHttpRequestContext.UserHostAddress);
            }
        }
示例#7
0
 /// <summary>
 /// Réduction des groupes intérieurs de 3 consonnes
 /// </summary>
 public static Rule Rule1()
 {
     return(R.Rule(c => c
                   .Id("p1c17r1")
                   .Query(
                       q => q.Match(m => m.Seq(
                                        s => s.Phon(p => IPA.IsConsonant(p) && !IPA.IsLiquide(p) &&
                                                    !IPA.IsFricative(p) && !IPA.IsGlide(p)),
                                        s => s.Phon(IPA.IsConsonant),
                                        s => s.Phon(IPA.IsConsonant))),
                       q => q.Match(m => m.Seq(
                                        s => s.Phon(IPA.IsConsonant),
                                        s => s.Phon(IPA.IsConsonant),
                                        s => s.Phon(p => IPA.IsConsonant(p) && !IPA.IsLiquide(p) &&
                                                    !IPA.IsFricative(p) && !IPA.IsGlide(p)))))
                   .Rules(r => r
                          .Named("Réduction des groupes intérieurs de 3 consonnes")
                          .Phono(px => new[] { px[0], px[2] })
                          .Rewrite(_ => _)
                          .Rewrite(g => $"{g[0]} {g[2]}"))));
 }
示例#8
0
        public bool Connect(string hostName, Int32 port)
        {
            Close();

            try
            {
                // Get the ip addresses for the give hostname, and then convert from ipv4 to ipv6 if necessary
                var HostAddresses = new List <IPAddress>();
                if (!Socket.OSSupportsIPv6)
                {
                    HostAddresses.AddRange(Dns.GetHostAddresses(hostName));
                    _Socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
                }
                else
                {
                    foreach (var IPA in Dns.GetHostAddresses(hostName))
                    {
                        if (IPA.AddressFamily == AddressFamily.InterNetwork)
                        {
                            HostAddresses.Add(IPAddress.Parse("::ffff:" + IPA.ToString()));
                        }
                        else
                        {
                            HostAddresses.Add(IPA);
                        }
                    }

                    _Socket = new Socket(AddressFamily.InterNetworkV6, SocketType.Stream, ProtocolType.Tcp);
                    // Only do the Mono check here because the XP check is done above
                    if (!ProcessUtils.IsRunningOnMono) // From: https://github.com/statianzo/Fleck/blob/master/src/Fleck/WebSocketServer.cs
                    {
#if __MonoCS__
#else
                        // Windows default to IPv6Only=true, so we call this to allow connections to both IPv4 and IPv6
                        // Mono will throw an exception, but that's OK because it defaults to allowing both IPv4 and IPv6
                        _Socket.SetSocketOption(SocketOptionLevel.IPv6, (SocketOptionName)27, false); // 27 = SocketOptionName.IPv6Only
#endif
                    }
                }

                _Socket.Blocking = true;
                _Socket.Connect(HostAddresses.ToArray(), port);
                if (_Socket.Connected)
                {
                    _LocalIP    = ((IPEndPoint)_Socket.LocalEndPoint).Address.ToString();
                    _LocalPort  = ((IPEndPoint)_Socket.LocalEndPoint).Port;
                    _RemoteIP   = ((IPEndPoint)_Socket.RemoteEndPoint).Address.ToString();
                    _RemotePort = ((IPEndPoint)_Socket.RemoteEndPoint).Port;
                    _Stream     = new NetworkStream(_Socket);

                    if (_RemoteIP.ToLower().StartsWith("::ffff:"))
                    {
                        _RemoteIP = _RemoteIP.Substring(7); // Trim leading ::ffff:
                    }
                    else if (((IPEndPoint)_Socket.RemoteEndPoint).Address.AddressFamily == AddressFamily.InterNetworkV6)
                    {
                        _RemoteIP = "[" + _RemoteIP + "]"; // Wrap IPv6 in []
                    }
                }
                return(_Socket.Connected);
            }
            catch (SocketException sex)
            {
                switch (sex.ErrorCode)
                {
                case 10060: break;     // Connection timed out

                case 10061: break;     // Connection refused

                case 10065: break;     // No route to host

                default: RMLog.DebugException(sex, "SocketException in TcpConnection::Connect().  ErrorCode=" + sex.ErrorCode.ToString()); break;
                }
                return(false);
            }
            catch (Exception ex)
            {
                RMLog.DebugException(ex, "Exception in TcpConnection::Connect()");
                return(false);
            }
        }
示例#9
0
        public IEnumerable <Interval <string> > GetSyllables(string[] phonemicWord)
        {
            var start            = 0;
            var syllablePhonemes = new List <string>();

            var lastPosition = SyllabicPosition.CODA;

            string current = null;

            for (int i = 0; i < phonemicWord.Length; i++)
            {
                current = phonemicWord[i];

                if (i == 0)
                {
                    if (IPA.IsVowel(current))
                    {
                        syllablePhonemes.Add(current);
                        lastPosition = SyllabicPosition.NUCLEUS;
                    }
                    else
                    {
                        syllablePhonemes.Add(current);
                        lastPosition = SyllabicPosition.ONSET;
                    }
                }
                else
                {
                    var last = phonemicWord[i - 1];
                    var next = i < phonemicWord.Length - 1 ? phonemicWord[i + 1] : null;

                    if (next == null)
                    {  // Last phoneme of the word
                        if (IPA.IsVowel(current) && IPA.IsVowel(last))
                        {
                            yield return(new Interval <string>(start,
                                                               syllablePhonemes.Count,
                                                               IPA.IsLong(current) ? "long" : "short"));

                            start += syllablePhonemes.Count;
                            syllablePhonemes.Clear();
                        }
                        syllablePhonemes.Add(current);
                        yield return(new Interval <string>(start,
                                                           syllablePhonemes.Count,
                                                           !IPA.IsVowel(current) || IPA.IsLong(current) ? "long" : "short"));
                    }
                    else if (IPA.IsVowel(current))
                    {
                        if (IPA.IsVowel(last))
                        {
                            yield return(new Interval <string>(start,
                                                               syllablePhonemes.Count,
                                                               IPA.IsLong(last) ? "long" : "short"));

                            start += syllablePhonemes.Count;
                            syllablePhonemes.Clear();
                        }

                        syllablePhonemes.Add(current);
                        lastPosition = SyllabicPosition.NUCLEUS;
                    }
                    else
                    {
                        if (IPA.IsVowel(last))
                        {
                            if (IPA.IsVowel(next))
                            {
                                yield return(new Interval <string>(start,
                                                                   syllablePhonemes.Count,
                                                                   IPA.IsLong(last) ? "long" : "short"));

                                start += syllablePhonemes.Count;
                                syllablePhonemes.Clear();

                                syllablePhonemes.Add(current);
                                lastPosition = SyllabicPosition.ONSET;
                            }
                            else if (IsOnsetCluster(current, next))
                            {
                                yield return(new Interval <string>(start,
                                                                   syllablePhonemes.Count,
                                                                   IPA.IsLong(last) ? "long" : "short"));

                                start += syllablePhonemes.Count;
                                syllablePhonemes.Clear();

                                syllablePhonemes.Add(current);
                                lastPosition = SyllabicPosition.ONSET;
                            }
                            else
                            {
                                syllablePhonemes.Add(current);
                                lastPosition = SyllabicPosition.CODA;
                            }
                        }
                        else
                        {
                            if (IPA.IsVowel(next))
                            {
                                if (lastPosition == SyllabicPosition.CODA)
                                {
                                    yield return(new Interval <string>(start,
                                                                       syllablePhonemes.Count,
                                                                       "long"));

                                    start += syllablePhonemes.Count;
                                    syllablePhonemes.Clear();
                                }

                                syllablePhonemes.Add(current);
                                lastPosition = SyllabicPosition.ONSET;
                            }
                            else
                            {
                                if (current == Phonemes.s)
                                {
                                    syllablePhonemes.Add(current);
                                    lastPosition = SyllabicPosition.CODA;
                                }
                                else
                                {
                                    yield return(new Interval <string>(start,
                                                                       syllablePhonemes.Count,
                                                                       "long"));

                                    start += syllablePhonemes.Count;
                                    syllablePhonemes.Clear();
                                    syllablePhonemes.Add(current);
                                    lastPosition = SyllabicPosition.ONSET;
                                }
                            }
                        }
                    }
                }
            }
        }
示例#10
0
 public bool IsOnsetCluster(string fst, string snd)
 {
     return((!IPA.IsVowel(fst) && !IPA.IsGlide(fst) && IPA.IsGlide(snd)) ||
            ((IPA.IsOcclusive(fst) || IPA.IsFricative(fst)) && IPA.IsLiquide(snd)));
 }
示例#11
0
        /// <summary>
        /// Loads $_SERVER from HttpRequest.ServerVariables.
        /// </summary>
        private void InitializeServerVariables(LocalConfiguration /*!*/ config, HttpContext context)
        {
            if (context == null)
            {
                Server.Value = new PhpArray();
                return;
            }

            Debug.Assert(config != null);

            PhpArray array, argv;

            var request         = context.Request;
            var serverVariables = request.ServerVariables;

            Server.Value = array = new PhpArray(0, /*serverVariables.Count*/ 64);

            // adds variables defined by ASP.NET and IIS:
            LoadFromCollection(array, serverVariables);

            // adds argv, argc variables:
            if (Configuration.Global.GlobalVariables.RegisterArgcArgv)
            {
                array["argv"] = argv = new PhpArray(1)
                {
                    request.QueryString
                };
                array["argc"] = 0;
            }

            // additional variables defined in PHP manual:
            array["PHP_SELF"] = request.Path;

            try
            {
                array["DOCUMENT_ROOT"] = request.MapPath("/"); // throws exception under mod_aspdotnet
            }
            catch
            {
                array["DOCUMENT_ROOT"] = null;
            }

            array["SERVER_ADDR"]     = serverVariables["LOCAL_ADDR"];
            array["REQUEST_URI"]     = request.RawUrl;
            array["REQUEST_TIME"]    = DateTimeUtils.UtcToUnixTimeStamp(context.Timestamp.ToUniversalTime());
            array["SCRIPT_FILENAME"] = request.PhysicalPath;

            //IPv6 is the default in IIS7, convert to an IPv4 address (store the IPv6 as well)
            if (request.UserHostAddress.Contains(":"))
            {
                array["REMOTE_ADDR_IPV6"] = request.UserHostAddress;

                if (request.UserHostAddress == "::1")
                {
                    array["REMOTE_ADDR"] = array["SERVER_ADDR"] = "127.0.0.1";
                }
                else
                {
                    foreach (IPAddress IPA in Dns.GetHostAddresses(request.UserHostAddress))
                    {
                        if (IPA.AddressFamily.ToString() == "InterNetwork")
                        {
                            array["REMOTE_ADDR"] = IPA.ToString();
                            break;
                        }
                    }
                }
            }

            // PATH_INFO
            // should contain partial path information only
            // note: IIS has AllowPathInfoForScriptMappings property that do the thing ... but ISAPI does not work then
            // hence it must be done here manually

            if (array.ContainsKey("PATH_INFO"))
            {
                string path_info   = (string)array["PATH_INFO"];
                string script_name = (string)array["SCRIPT_NAME"];

                // 'ORIG_PATH_INFO'
                // Original version of 'PATH_INFO' before processed by PHP.
                array["ORIG_PATH_INFO"] = path_info;

                // 'PHP_INFO'
                // Contains any client-provided pathname information trailing the actual script filename
                // but preceding the query string, if available. For instance, if the current script was
                // accessed via the URL http://www.example.com/php/path_info.php/some/stuff?foo=bar,
                // then $_SERVER['PATH_INFO'] would contain /some/stuff.

                // php-5.3.2\sapi\isapi\php5isapi.c:
                //
                // strncpy(path_info_buf, static_variable_buf + scriptname_len - 1, sizeof(path_info_buf) - 1);    // PATH_INFO = PATH_INFO.SubString(SCRIPT_NAME.Length);


                array["PATH_INFO"] = (script_name.Length <= path_info.Length) ? path_info.Substring(script_name.Length) : string.Empty;
            }
        }
示例#12
0
        public bool Generar(string data, out int totalPA, out int registradosPA, out int registradosPersonas)
        {
            string[] arrChecked = data.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);

            totalPA             = arrChecked.Length;
            registradosPA       = 0;
            registradosPersonas = 0;
            bool all_result = true;

            bool TMP       = true;
            int  NOT_FOUND = -1;

            List <string> listIDSIU = new List <string>();

            foreach (string itemChecked in arrChecked)
            {
                long.TryParse(itemChecked, out PK_PA);

                bool ok;
                bool personaActualizada;

                IPersona persona = this as IPersona;
                IPA      PA      = this as IPA;

                if (PA.editPA(TMP))
                {
                    personaActualizada = listIDSIU.Contains(IDSIU);

                    if (personaActualizada || persona.editPersona(TMP))
                    {
                        if (personaActualizada)
                        {
                            ok = true;
                        }
                        else
                        {
                            if (persona.findPersona() == NOT_FOUND)
                            {
                                ok = persona.addPersona();
                            }
                            else
                            {
                                ok = persona.savePersona();
                            }
                            registradosPersonas++;
                        }

                        if (ok)
                        {
                            if (PA.findPA() == NOT_FOUND)
                            {
                                ok = PA.addPA();
                            }
                            else
                            {
                                ok = PA.savePA();
                            }

                            if (ok)
                            {
                                markPersona();
                                markPA();
                                registradosPA++;

                                if (personaActualizada == false)
                                {
                                    listIDSIU.Add(IDSIU);
                                }
                                continue;
                            }
                        }
                    }
                }
                all_result = false;
                break;
            }

            return(all_result);
        }
示例#13
0
        /// <summary>
        /// Метод определяющий IP адресс по имени компьютера или адресу в формате IpV6
        /// </summary>
        /// <param name="IpV6AddrOrHostname">Имя компьютера или адрес в формате IpV6</param>
        /// <param name="networkpattern">Параметр позволяющий вернуть верный IP адрес, т.к. их может быть несколько
        /// Формат параметра "x.x.x.0"</param>
        /// <returns></returns>
        public static string GetIP4Address(string IpV6AddrOrHostname, string networkpattern)
        {
            string IP4Address = String.Empty;

            foreach (IPAddress IPA in Dns.GetHostAddresses(IpV6AddrOrHostname))
            {
                if (IPA.AddressFamily.ToString() == "InterNetwork")
                {
                    IP4Address = IPA.ToString();
                    if (!string.IsNullOrEmpty(networkpattern))
                    {
                        string[] digits = networkpattern.Split('.');
                        if (digits.Length < 2)
                        {
                            throw new Exception("Wrong network pattern");
                        }
                        else
                        {
                            string[] digits2 = IP4Address.Split('.');
                            if (digits[0] == digits2[0] && digits[1] == digits2[1] && digits[2] == digits2[2])
                            {
                                break;
                            }
                        }
                    }
                    else
                    {
                        break;
                    }
                }
            }

            if (IP4Address != String.Empty)
            {
                return(IP4Address);
            }

            foreach (IPAddress IPA in Dns.GetHostAddresses(Dns.GetHostName()))
            {
                if (IPA.AddressFamily.ToString() == "InterNetwork")
                {
                    IP4Address = IPA.ToString();
                    if (!string.IsNullOrEmpty(networkpattern))
                    {
                        string[] digits = networkpattern.Split('.');
                        if (digits.Length < 2)
                        {
                            throw new Exception("Wrong network pattern");
                        }
                        else
                        {
                            string[] digits2 = IP4Address.Split('.');
                            if (digits[0] == digits2[0] && digits[1] == digits2[1] && digits[2] == digits2[2])
                            {
                                break;
                            }
                        }
                    }
                    else
                    {
                        break;
                    }
                }
            }

            return(IP4Address);
        }
示例#14
0
        /// <summary>
        /// Loads $_SERVER from <see cref="HttpRequest.ServerVariables"/>.
        /// </summary>
        protected override PhpArray InitServerVariable()
        {
            var array = new PhpArray(32);

            var request         = _httpctx.Request;
            var serverVariables = request.ServerVariables;

            // adds variables defined by ASP.NET and IIS:
            foreach (string name in serverVariables)
            {
                // gets all values associated with the name:
                string[] values = serverVariables.GetValues(name);

                if (values == null)
                {
                    continue;   // http://phalanger.codeplex.com/workitem/30132
                }
                // adds all items:
                if (name != null)
                {
                    foreach (string value in values)
                    {
                        Superglobals.AddVariable(array, name, value, null);
                    }
                }
                else
                {
                    // if name is null, only name of the variable is stated:
                    // e.g. for GET variables, URL looks like this: ...&test&...
                    // we add the name of the variable and an emtpy string to get what PHP gets:
                    foreach (string value in values)
                    {
                        Superglobals.AddVariable(array, value, string.Empty, null);
                    }
                }
            }

            //// adds argv, argc variables:
            //if (RegisterArgcArgv)
            //{
            //    array["argv"] = PhpValue.Create(new PhpArray(1) { request.QueryString });
            //    array["argc"] = PhpValue.Create(0);
            //}

            // additional variables defined in PHP manual:
            array["PHP_SELF"] = (PhpValue)request.Path;

            try
            {
                array["DOCUMENT_ROOT"] = (PhpValue)request.MapPath("/"); // throws exception under mod_aspdotnet
            }
            catch
            {
                array["DOCUMENT_ROOT"] = PhpValue.Null;
            }

            array["SERVER_ADDR"]     = (PhpValue)serverVariables["LOCAL_ADDR"];
            array["REQUEST_URI"]     = (PhpValue)request.RawUrl;
            array["REQUEST_TIME"]    = (PhpValue)Utilities.DateTimeUtils.UtcToUnixTimeStamp(_httpctx.Timestamp.ToUniversalTime());
            array["SCRIPT_FILENAME"] = (PhpValue)request.PhysicalPath;

            //IPv6 is the default in IIS7, convert to an IPv4 address (store the IPv6 as well)
            if (request.UserHostAddress.Contains(":"))
            {
                array["REMOTE_ADDR_IPV6"] = (PhpValue)request.UserHostAddress;

                if (request.UserHostAddress == "::1")
                {
                    array["REMOTE_ADDR"] = array["SERVER_ADDR"] = (PhpValue)"127.0.0.1";
                }
                else
                {
                    foreach (IPAddress IPA in Dns.GetHostAddresses(request.UserHostAddress))
                    {
                        if (IPA.AddressFamily.ToString() == "InterNetwork")
                        {
                            array["REMOTE_ADDR"] = (PhpValue)IPA.ToString();
                            break;
                        }
                    }
                }
            }

            // PATH_INFO
            // should contain partial path information only
            // note: IIS has AllowPathInfoForScriptMappings property that do the thing ... but ISAPI does not work then
            // hence it must be done here manually

            if (array.ContainsKey("PATH_INFO"))
            {
                string path_info   = array["PATH_INFO"].AsString();
                string script_name = array["SCRIPT_NAME"].AsString();

                // 'ORIG_PATH_INFO'
                // Original version of 'PATH_INFO' before processed by PHP.
                array["ORIG_PATH_INFO"] = (PhpValue)path_info;

                // 'PHP_INFO'
                // Contains any client-provided pathname information trailing the actual script filename
                // but preceding the query string, if available. For instance, if the current script was
                // accessed via the URL http://www.example.com/php/path_info.php/some/stuff?foo=bar,
                // then $_SERVER['PATH_INFO'] would contain /some/stuff.

                // php-5.3.2\sapi\isapi\php5isapi.c:
                //
                // strncpy(path_info_buf, static_variable_buf + scriptname_len - 1, sizeof(path_info_buf) - 1);    // PATH_INFO = PATH_INFO.SubString(SCRIPT_NAME.Length);

                array["PATH_INFO"] = (PhpValue)((script_name.Length <= path_info.Length) ? path_info.Substring(script_name.Length) : string.Empty);
            }

            //
            return(array);
        }