示例#1
0
        /// <summary>
        ///     Public method used to create an instance of the custom Profiles session object.
        /// </summary>
        public string SessionCreate()
        {
            ProfilesSearchAPI.Utilities.DataIO dataio = new ProfilesSearchAPI.Utilities.DataIO();

            Session session  = new Session();
            string  hostname = System.Net.Dns.GetHostName();

            string ipaddress = string.Empty;

            try
            {
                ipaddress = System.Net.Dns.GetHostAddresses(hostname).GetValue(1).ToString();
            }
            catch (Exception ex)
            {
                ProfilesSearchAPI.Utilities.DebugLogging.Log(ex.Message + " ++ " + ex.StackTrace);
                ipaddress = "";
            }

            session.RequestIP = ipaddress;
            session.UserAgent = "Search API";

            dataio.SessionCreate(ref session);

            //Store the object in the current session of the user.
            return(session.SessionID);
        }
示例#2
0
        /// <summary>
        ///     Public method used to create an instance of the custom Profiles session object.
        /// </summary>
        public string SessionCreate()
        {
            ProfilesSearchAPI.Utilities.DataIO dataio = new ProfilesSearchAPI.Utilities.DataIO();

            Session session = new Session();
            string hostname = System.Net.Dns.GetHostName();

            string ipaddress = string.Empty;
            try
            {
                ipaddress = System.Net.Dns.GetHostAddresses(hostname).GetValue(1).ToString();
            }
            catch (Exception ex)
            {
                ProfilesSearchAPI.Utilities.DebugLogging.Log(ex.Message + " ++ " + ex.StackTrace);
                ipaddress = "";
            }

            session.RequestIP = ipaddress;
            session.UserAgent = "Search API";

            dataio.SessionCreate(ref session);

            //Store the object in the current session of the user.
            return session.SessionID;
        }