当前位置: 首页>>代码示例>>C#>>正文


C# SessionInfo.setSessionData方法代码示例

本文整理汇总了C#中SessionInfo.setSessionData方法的典型用法代码示例。如果您正苦于以下问题:C# SessionInfo.setSessionData方法的具体用法?C# SessionInfo.setSessionData怎么用?C# SessionInfo.setSessionData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SessionInfo的用法示例。


在下文中一共展示了SessionInfo.setSessionData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: successPersisted

        private void successPersisted(string supplmentmessage, ServiceUsers updateUser)
        {
            if (supplmentmessage == null)
                supplmentmessage = "<span style=\"color:PaleGreen \">The user was sucessfully " + actiontext + ".</span>";
            else
                supplmentmessage = "<span style=\"color:Maroon\">" + supplmentmessage + ".</span>";
            SessionInfo info = new SessionInfo();
            string hostnameSession = null;
            string confignameSession = null;
            info.getHostNameConfigName(out hostnameSession, out confignameSession);
            if (oldUser != null && oldUser.UserKey == user.UserKey && (hostnameSession.Equals(hostNameIdentifier) && confignameSession.Equals(configName)))
            {
                string addressSes = null;
                string IDSes = null;
                ServiceUsers csUserSes = null;
                string confignameSes = null;
                string hosterSes = null;
                string versionSes = null;
                string platformSes = null;
                string clientSession = null;
                string nameSes = null;
                info.getSessionData(false, out addressSes, out csUserSes, out clientSession, out nameSes, out confignameSes, out hosterSes, out versionSes, out platformSes, out IDSes);
                HttpCookie cookie = info.setSessionData(addressSes, updateUser, clientSession, nameSes, confignameSes, hosterSes, versionSes, platformSes,IDSes);
                Response.Cookies.Remove(cookie.Name);
                Response.Cookies.Add(cookie);
                user = updateUser;
            }
            userList = configProxy.getServiceUsers(hostNameIdentifier, configName, traversePath, user);
            if (userList == null)
                Response.Redirect(ConfigSettings.PAGE_NODES, true);
            if (action.Equals(ConfigUtility.ADD_USER))
                thisUser = userList.Find(delegate(ServiceUsers userExist) { return userExist.UserId.ToLower().Equals(updateUser.UserId.ToLower()) && userExist.LocalUser == updateUser.LocalUser && userExist.Password.Equals(updateUser.Password); });
            else
                if (action.Equals(ConfigUtility.UPDATE_USER))
                    thisUser = userList.Find(delegate(ServiceUsers userExist) { return userExist.UserKey == thisUser.UserKey; });
            UpdateMessage.Text = supplmentmessage;
            if (action == ConfigUtility.REMOVE_USER && !oldUser.LocalUser)
                UpdateMessage.Text = UpdateMessage.Text + "<br>Note that all Connected Service Definitions and corresponding active Connection Point instances associated with the Connected Service user have also been removed from the configuration database.";
            ViewState["thisUser"] = thisUser;
            ViewState["oldUser"] = thisUser;
            ViewState["identify"] = thisUser.UserKey.ToString();
            if (action.Equals(ConfigUtility.ADD_USER))
            {
                Add.Enabled = false;
                Update.Enabled = true;
                Delete.Enabled = true;
            }
            if (action.Equals(ConfigUtility.REMOVE_USER))
            {
                Add.Enabled = false;
                Update.Enabled = false;
                Delete.Enabled = false;
            }
            ViewState["userList"] = userList;
            action = ConfigUtility.UPDATE_USER;
            ViewState["action"] = action;
            ViewState["CompositeServiceData"] = null;

        }
开发者ID:vactorwu,项目名称:catch23-project,代码行数:59,代码来源:ManageUsers.aspx.cs

示例2: processUpdate


//.........这里部分代码省略.........
                        UpdateMessageAzureLB.Text = "<br/><span style=\"color:#FFFF99;\">WARNING: You are hosting on Windows Azure so typically, you should mark your Configuration Service and Primary endpoints as externally load balanced on this page; and supply " +
                            "the Azure hosted service DNS base address + port for this endpoint.  Windows Azure will <strong>always</strong> externally load balance input endpoints.  By not specifiying the external load balance address and port" +
                            " (for example azurestocktraderbsl.cloudapp.net:443) on this page, Configuration Service may not work properly. It is very important to get the address and port exactly right.  The update has gone through, " +
                            "but after considering this message, you can make any adjustments and update the endpoint again with the correct Azure public-facing address + port.  If this is an internal endpoint, you can ignore this message.</span>";
                    }
                }
                try
                {
                    configProxy.Channel = null;
                    traversePath = DynamicTraversePath.getTraversePath(hostNameIdentifier, configName, ref configProxy, address, binding, user);
                    compositeServiceData = configProxy.getServiceConfiguration(hostNameIdentifier, configName, ConfigUtility.CONFIG_LEVEL_BASIC, false, traversePath, user);
                }
                catch (Exception)
                {
                    //Try again for good measure.
                    Thread.Sleep(3000);
                    try
                    {
                        traversePath = DynamicTraversePath.getTraversePath(hostNameIdentifier, configName, ref configProxy, address, binding, user);
                        compositeServiceData = null;
                        compositeServiceData = configProxy.getServiceConfiguration(hostNameIdentifier, configName, ConfigUtility.CONFIG_LEVEL_BASIC, false, traversePath, user);
                        if (compositeServiceData == null || compositeServiceData[0] == null)
                        {
                            UpdateMessage.Text = "<br/><span style=\"color:Maroon\">Error! The Configuration Service was not able to restart with your new definition.  Please check the event log.  You will" +
                                "not be able to continue until this is fixed, since ConfigWeb has no way to establish a connection to the Configuration Service, since it is no longer running at the remote host(s).</span>";
                            return;
                        }
                    }
                    catch (Exception)
                    {
                        UpdateMessage.Text = "<br/><span style=\"color:Maroon\">Error! The Configuration Service was not able to restart with your new definition.  Please check the event log.  You will" +
                               "not be able to continue until you login in again.  If there is an errror starting the Configuration Service Host, you will not be able to login until this issue is fixed.</span>";
                        SessionInfo info = new SessionInfo();
                        info.setSessionData(null, null, null, null, null, null, null, null, null);
                        return;
                    }
                }
                switch (action)
                {
                    case ConfigUtility.ADD_HOSTED_SERVICE:
                        {
                            if (compositeServiceData != null)
                            {
                                thisService = compositeServiceData[0].HostedServices.Find(delegate(HostedServices hsExist) { return hsExist.FriendlyName == updateHostedService.FriendlyName && hsExist.ServiceHostID == SHID; });
                                //thisService = updateHostedService;
                                if (thisService != null)
                                {
                                    thisOldService = thisService;
                                    SHID = thisService.ServiceHostID;
                                    ViewState["SHID"] = SHID;
                                    HSID = thisService.HostedServiceID;
                                    ViewState["HSID"] = HSID;
                                    ViewState["CompositeServiceData"] = compositeServiceData;
                                    ViewState["thisOldService"] = thisService;
                                    ViewState["thisService"] = thisService;
                                    action = ConfigUtility.UPDATE_HOSTED_SERVICE;
                                    ViewState["action"] = action;
                                    Add.Enabled = false;
                                    Update.Enabled = true;
                                    Delete.Enabled = true;
                                }
                            }
                            break;
                        }
                    case ConfigUtility.REMOVE_HOSTED_SERVICE:
                        {
开发者ID:vactorwu,项目名称:catch23-project,代码行数:67,代码来源:UpdateHostedService.aspx.cs


注:本文中的SessionInfo.setSessionData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。