コード例 #1
0
ファイル: Import.cs プロジェクト: Br3nda/sfdocsamples
        public Import(KeepconPost post)
        {
            this.Contents    = new List <Content>();
            this.Contenttype = post.KeepconCustomerCare;


            Content wContent = new Content();

            wContent.Author = new Author("author", "allus");

            //wContent.Date = System.DateTime.Now;
            wContent.Id        = post.PostID;
            wContent.Text.Text = post.Message;
            // wContent.Url_Context.Text = "http://allus.com.ar";

            this.Contents.Add(wContent);
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: Br3nda/sfdocsamples
        private void btn_GetMsg_Click(object sender, EventArgs e)
        {
            StringBuilder strb         = new StringBuilder();
            KeepconPost   wKeepconPost = KeepconSvc.GetPostById(Convert.ToInt32(txtPostId.Text));

            strb.AppendLine("Texto Original");
            strb.AppendLine();
            strb.AppendLine(wKeepconPost.Message);

            strb.AppendLine();
            strb.AppendLine("Texto convertido a UTF-8");
            UTF8Encoding wEncoding = new UTF8Encoding();

            Byte[] wByte = wEncoding.GetBytes(wKeepconPost.Message);
            strb.AppendLine(wEncoding.GetString(wByte));


            UnicodeEncoding wEncoding_Unicode = new UnicodeEncoding();

            strb.AppendLine();
            strb.AppendLine("Texto convertido a Unicode");
            wByte = wEncoding_Unicode.GetBytes(wKeepconPost.Message);
            strb.AppendLine(wEncoding_Unicode.GetString(wByte));


            ASCIIEncoding wEncoding_ASCII = new ASCIIEncoding();

            wByte = wEncoding_ASCII.GetBytes(wKeepconPost.Message);


            strb.AppendLine();
            strb.AppendLine("Texto convertido a ASCII");
            strb.AppendLine(wEncoding_ASCII.GetString(wByte));



            txtImport.Text = strb.ToString();
        }