www.pudn.com > Fetion.rar > CrbtChannel.cs


namespace Imps.Client.Pc.Channel 
{ 
    using Imps.Client.Core; 
    using Imps.Client.Pc; 
    using System; 
    using System.Runtime.InteropServices; 
    using System.Text; 
 
    [ComVisible(true)] 
    public class CrbtChannel : WebPageChannel 
    { 
        public CrbtChannel(IFrameworkWindow host) : base(host) 
        { 
        } 
 
        private byte[] CreatePostData(User user) 
        { 
            StringBuilder builder = new StringBuilder(); 
            builder.AppendFormat("province={0}", user.PersonalInfo.Province.Value); 
            builder.AppendFormat("&city={0}", user.PersonalInfo.City.Value); 
            builder.AppendFormat("&c={0}", user.SsicUrlEncoded); 
            return Encoding.UTF8.GetBytes(builder.ToString()); 
        } 
 
        public override bool Load(string strUri, string args) 
        { 
            string baseUrl = this.BaseUrl; 
            if (string.IsNullOrEmpty(baseUrl)) 
            { 
                base.NavigateToBlankPage(); 
            } 
            else 
            { 
                base.InitUrl = baseUrl; 
                byte[] postData = this.CreatePostData(base.FrameworkWnd.AccountManager.CurrentUser); 
                base.InnerWebBrowser.Navigate(base.InitUrl, postData); 
            } 
            return true; 
        } 
 
        private string BaseUrl 
        { 
            get 
            { 
                return base.FrameworkWnd.AccountManager.CurrentUser.Configuration.SystemSetting.ServerUriSetting.CrbtPortal; 
            } 
        } 
    } 
}