當前位置: 首頁>>代碼示例>>C#>>正文


C# ASObject.getInt方法代碼示例

本文整理匯總了C#中ASObject.getInt方法的典型用法代碼示例。如果您正苦於以下問題:C# ASObject.getInt方法的具體用法?C# ASObject.getInt怎麽用?C# ASObject.getInt使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ASObject的用法示例。


在下文中一共展示了ASObject.getInt方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: sendReceiptMail

        /// <summary>
        /// 發送閱讀回折郵件
        /// </summary>
        /// <param name="sHtmlText">郵件內容</param>
        /// <param name="from">發送人</param>
        /// <param name="to">接收人</param>
        public void sendReceiptMail(string sHtmlText, string subject, ASObject from, string[] to)
        {
            using (MemoryStreamEx stream = new MemoryStreamEx(32000))
            {
                Mail_Message m = new Mail_Message();
                m.MimeVersion = "1.0";
                m.Date = DateTime.Now;
                m.MessageID = MIME_Utils.CreateMessageID();

                m.Subject = subject;
                StringBuilder sb = new StringBuilder();
                foreach (string p in to)
                {
                    if (sb.Length > 0)
                        sb.Append(",");
                    sb.Append(p);
                }
                m.To = Mail_t_AddressList.Parse(sb.ToString());

                //--- multipart/alternative -----------------------------------------------------------------------------------------
                MIME_h_ContentType contentType_multipartAlternative = new MIME_h_ContentType(MIME_MediaTypes.Multipart.alternative);
                contentType_multipartAlternative.Param_Boundary = Guid.NewGuid().ToString().Replace('-', '.');
                MIME_b_MultipartAlternative multipartAlternative = new MIME_b_MultipartAlternative(contentType_multipartAlternative);
                m.Body = multipartAlternative;

                //--- text/plain ----------------------------------------------------------------------------------------------------
                MIME_Entity entity_text_plain = new MIME_Entity();
                MIME_b_Text text_plain = new MIME_b_Text(MIME_MediaTypes.Text.plain);
                entity_text_plain.Body = text_plain;
                text_plain.SetText(MIME_TransferEncodings.QuotedPrintable, Encoding.UTF8, sHtmlText);
                multipartAlternative.BodyParts.Add(entity_text_plain);

                //--- text/html ------------------------------------------------------------------------------------------------------
                MIME_Entity entity_text_html = new MIME_Entity();
                MIME_b_Text text_html = new MIME_b_Text(MIME_MediaTypes.Text.html);
                entity_text_html.Body = text_html;
                text_html.SetText(MIME_TransferEncodings.QuotedPrintable, Encoding.UTF8, sHtmlText);
                multipartAlternative.BodyParts.Add(entity_text_html);

                MIME_Encoding_EncodedWord headerwordEncoder = new MIME_Encoding_EncodedWord(MIME_EncodedWordEncoding.Q, Encoding.UTF8);
                m.ToStream(stream, headerwordEncoder, Encoding.UTF8);
                stream.Position = 0;

                SMTP_Client.QuickSendSmartHost(null, from.getString("send_address", "stmp.sina.com"), from.getInt("send_port", 25),
                    from.getBoolean("is_send_ssl", false), from.getString("account"), PassUtil.Decrypt(from.getString("password")),
                    from.getString("account"), to, stream);
            }
        }
開發者ID:nbhopson,項目名稱:QMail,代碼行數:54,代碼來源:MailWorker.cs

示例2: send

        /// <summary>
        /// 發送郵件
        /// </summary>
        /// <param name="mm">郵件對象</param>
        /// <param name="from">發送人</param>
        /// <param name="to">接收人</param>
        private void send(Mail_Message mm, ASObject from, string[] to)
        {
            using (MemoryStreamEx stream = new MemoryStreamEx(32000))
            {
                MIME_Encoding_EncodedWord headerwordEncoder = new MIME_Encoding_EncodedWord(MIME_EncodedWordEncoding.Q, Encoding.UTF8);
                mm.ToStream(stream, headerwordEncoder, Encoding.UTF8);
                stream.Position = 0;

                SMTP_Client.QuickSendSmartHost(null, from.getString("send_address", "stmp.sina.com"), from.getInt("send_port", 25),
                    from.getBoolean("is_send_ssl", false), from.getString("account"), PassUtil.Decrypt(from.getString("password")),
                    from.getString("account"), to, stream);
            }
        }
開發者ID:nbhopson,項目名稱:QMail,代碼行數:19,代碼來源:MailSendWorker.cs

示例3: executeRecvMaill

        private void executeRecvMaill(ASObject ac, string pubId)
        {
            mailAccount = new MailAccount();

            mailAccount.pubId = pubId;
            mailAccount.account = ac.getString("account");
            mailAccount.name = ac.getString("name");
            mailAccount.recv_server = ac.getString("recv_address");
            mailAccount.recv_port = ac.getInt("recv_port");
            mailAccount.recv_type = (ac.getInt("recv_type") == 1 ? MailAccount.RECV_TYPE.POP3 : MailAccount.RECV_TYPE.IMAP);
            mailAccount.password = PassUtil.Decrypt(ac.getString("password"));
            mailAccount.recv_ssl = ac.getBoolean("is_recv_ssl");

            uids = new List<string>();
            /*
            DataSet ds = DBWorker.ExecuteQuery("select mail_uid from ML_Mail where mail_account = '" + mailAccount.account + "'");
            if (ds.Tables.Count > 0)
            {
                DataTable dt = ds.Tables[0];
                foreach (DataRow row in dt.Rows)
                {
                    if (String.IsNullOrWhiteSpace(row[0] as string))
                        continue;
                    uids.Add((string)row[0]);
                }
            }*/
            //獲取賬戶對應的所有UIDs
            object result = Remoting.call("MailManager.getMailAccountUids", new object[] { mailAccount.account });
            object[] record = result as object[];
            if (record != null && record.Length > 0)
            {
                foreach (object r in record)
                {
                    uids.Add(r as string);
                }
            }

            try
            {
                if (mailAccount.recv_type == MailAccount.RECV_TYPE.POP3)
                {
                    pop3RecvMail();
                }
                else if (mailAccount.recv_type == MailAccount.RECV_TYPE.IMAP)
                {
                    imapRecvMail();
                }

                if (hasError)
                    throw new Exception("郵件已全部接收完成,但至少有一封郵件發生錯誤,相關內容請查看詳細信息。");
            }
            catch (Exception e)
            {
                throw e;
            }
        }
開發者ID:nbhopson,項目名稱:QMail,代碼行數:56,代碼來源:MailReceiveWorker.cs

示例4: showMail

        private void showMail(ASObject mail)
        {
            try
            {
                webBrowser.Navigate("about:blank");
                attachments.Children.Clear();

                Subject.Text = mail["subject"] as string;
                DateTime date = (DateTime)mail["mail_date"];
                if (date != null)
                    Date.Text = date.ToString("yyyy-MM-dd HH:mm");
                else
                    Date.Text = "";

                Sender.Text = mail["mail_from_label"] as string;

                int customer_grade = mail.getInt("customer_grade");

                GradeLabel.Text = getGradeLabel(customer_grade);
                GradeImage.Source = getGradeImage(customer_grade);

                int handle_action = mail.getInt("handle_action");
                HandleActionLabel.Text = getHandleAction(handle_action);
                HandleActionImage.Source = getHandleActionImage(handle_action);

                /*
                string remark = mail.getString("remark");
                if (String.IsNullOrWhiteSpace(remark))
                    txtRemark.Visibility = System.Windows.Visibility.Collapsed;
                else
                    txtRemark.Text = remark;
                 * */

                string contents = mail["contents"] as string;
                if (!String.IsNullOrEmpty(contents))
                {
                    XmlDocument contentsXml = new XmlDocument();
                    contentsXml.LoadXml(CleanInvalidXmlChars(contents));
                    string htmlfile = null;
                    bool hasText = false;
                    string root_path;

                    root_path = Desktop.instance.ApplicationPath + "/mail/" + mail["mail_file"];
                    DirectoryInfo dirinfo = Directory.GetParent(root_path);
                    root_path = dirinfo.FullName + "/" + mail["uuid"] + ".parts/";

                    foreach (XmlElement xml in contentsXml.GetElementsByTagName("PART"))
                    {
                        string type = xml.GetAttribute("type");
                        if (type == "html")
                        {
                            htmlfile = root_path + mail["uuid"] + ".html";
                        }
                        else if (type == "text")
                        {
                            hasText = true;
                        }
                        else if (type == "file")
                        {
                            if (String.IsNullOrEmpty(xml.GetAttribute("content-id")))
                            {
                                AttachmentItem item = new AttachmentItem();
                                item.SetAttachment(root_path + xml.GetAttribute("filename"));
                                attachments.Children.Add(item);
                            }
                        }
                    }

                    if (!String.IsNullOrEmpty(htmlfile))
                    {
                        if (File.Exists(htmlfile))
                        {
                            Uri uri = new Uri("file:///" + htmlfile);
                            webBrowser.Navigate(uri);
                        }
                    }
                    else if (hasText)
                    {
                        string textfile = root_path + mail["uuid"] + ".text.html";
                        if (File.Exists(textfile))
                        {
                            Uri uri = new Uri("file:///" + textfile);
                            webBrowser.Navigate(uri);
                        }
                    }
                }

                txtFrom.Text = mail.getString("country_from");
                txtArea.Text = (String.IsNullOrWhiteSpace(mail.getString("area_from")) ? "" : mail.getString("area_from"));
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.Write(e.StackTrace);
                ime.controls.MessageBox.Show(e.Message, "錯誤", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
開發者ID:nbhopson,項目名稱:QMail,代碼行數:96,代碼來源:MailViewWindow.xaml.cs

示例5: ShowMail

        public void ShowMail(ASObject mail, bool isSearch = false)
        {
            btnGrade.IsEnabled = !isSearch;
            btnRemark.IsEnabled = !isSearch;
            btnHandle.IsEnabled = !isSearch;

            if (mail.getString("folder") != "INBOX" && !isSearch)
            {
                btnGrade.IsEnabled = false;
                btnRemark.IsEnabled = false;
                btnHandle.IsEnabled = false;
            }

            hideTranslate();

            tobTranslate.IsChecked = false;

            this.mail = mail;
            try
            {
                root.Visibility = System.Windows.Visibility.Visible;
                Mouse.OverrideCursor = Cursors.Wait;

                webBrowser.Navigate("about:blank");
                attachments.Children.Clear();

                txtSubject.Text = mail["subject"] as string;
                DateTime date = (DateTime)mail["mail_date"];
                if (date != null)
                    txtDate.Text = date.ToString("yyyy-MM-dd HH:mm");
                else
                    txtDate.Text = "";

                txtSender.Text = mail["mail_from_label"] as string;

                int customer_grade = mail.getInt("customer_grade");

                txtGradeLabel.Text = getGradeLabel(customer_grade);
                imgGrade.Source = getGradeImage(customer_grade);

                int handle_action = mail.getInt("handle_action");
                txtHandleAction.Text = getHandleAction(handle_action);
                imgHandleAction.Source = getHandleActionImage(handle_action);

                string contents = mail["contents"] as string;
                string file = Desktop.instance.ApplicationPath + "/mail/" + mail["mail_file"];
                if (String.IsNullOrEmpty(contents) || !File.Exists(file))
                {
                    if (!isSearch)
                    {
                        MailWorker.instance.ParseMail(mail);
                        MailWorker.instance.updateMailRecord(mail, new string[] { "attachments", "contents" });
                    }
                    else
                        MailWorker.instance.ParseMail(mail);
                    contents = mail["contents"] as string;
                }
                XmlDocument contentsXml = new XmlDocument();
                if (!String.IsNullOrEmpty(contents))
                {
                    contentsXml.LoadXml(CleanInvalidXmlChars(contents));
                    string htmlfile = null;
                    bool hasText = false;
                    string root_path;

                    root_path = Desktop.instance.ApplicationPath + "/mail/" + mail["mail_file"];
                    DirectoryInfo dirinfo = Directory.GetParent(root_path);
                    root_path = dirinfo.FullName + "/" + mail["uuid"] + ".parts/";

                    foreach (XmlElement xml in contentsXml.GetElementsByTagName("PART"))
                    {
                        string type = xml.GetAttribute("type");
                        if (type == "html")
                        {
                            htmlfile = root_path + mail["uuid"] + ".html";
                        }
                        else if (type == "text")
                        {
                            hasText = true;
                        }
                        else if (type == "file")
                        {
                            if (String.IsNullOrEmpty(xml.GetAttribute("content-id")))
                            {
                                AttachmentItem item = new AttachmentItem();
                                item.SetAttachment(root_path + xml.GetAttribute("filename"));
                                attachments.Children.Add(item);
                            }
                        }
                    }

                    if (!String.IsNullOrEmpty(htmlfile))
                    {
                        if (File.Exists(htmlfile))
                        {
                            Uri uri = new Uri("file:///" + htmlfile);
                            webBrowser.Navigate(uri);
                        }
                    }
                    else if (hasText)
//.........這裏部分代碼省略.........
開發者ID:nbhopson,項目名稱:QMail,代碼行數:101,代碼來源:MailReader.xaml.cs


注:本文中的ASObject.getInt方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。