Пример #1
0
        private async void MainTabControl_SelectedIndexChanged(object sender, EventArgs e)
        {
            string name = nameTextBox.Text;

            if (name.IndexOf("#") != -1)
            {
                string[] splitName = name.Split('#');
                string   trip      = VIPBrowserLibrary.Chron.CreateTrip.Create(splitName[1]);
                name = splitName[0] + " ◆" + trip;
            }
            else if (String.IsNullOrEmpty(name))
            {
                VIPBrowserLibrary.Common.BBSType bt = VIPBrowserLibrary.Common.TypeJudgment.BBSTypeJudg(this.Url);
                string flo = VIPBrowserLibrary.Common.URLParse.DatToFolder(this.Url, bt);
                if (bt != VIPBrowserLibrary.Common.BBSType.machibbs)
                {
                    Dictionary <string, string> data = await VIPBrowserLibrary.Common.GetBoardData.GetBoardDictionary(flo, false);

                    name = data["BBS_NONAME_NAME"];
                }
                else
                {
                    name = "名無しさん";
                }
            }
            string mail     = mailTextBox.Text;
            string sentence = sentenceTextBox.Text;

            sentence = VIPBrowserLibrary.Utility.StringUtility.HTMLEncode(sentence);
            string date  = DateTime.Now.ToString("yyyy/MM/dd(ddd) HH:mm:ss.ff");
            Res    r     = new Res(NowResCount + 1, name, mail, sentence, String.Empty, date, String.Empty, true);
            string datas = ResConvert.SimpleConvertCore(r);

            this.webBrowser1.DocumentText = "<html><head></head><body><font face=\"MS Pゴシック\">\n<dl>\n" + datas + "</body></html>";
        }
Пример #2
0
        public string OfflineSetUrl(string url)
        {
            VIPBrowserLibrary.Common.BBSType           bt = VIPBrowserLibrary.Common.TypeJudgment.BBSTypeJudg(url);
            VIPBrowserLibrary.BBS.Common.IThreadReader itr;
            switch (bt)
            {
            case VIPBrowserLibrary.Common.BBSType._2ch:
                itr = new VIPBrowserLibrary.BBS.X2ch.X2chThreadReader(url);
                break;

            case VIPBrowserLibrary.Common.BBSType.jbbs:
                itr = new VIPBrowserLibrary.BBS.Jbbs.JbbsThreadReader(url);
                break;

            case VIPBrowserLibrary.Common.BBSType.machibbs:
                itr = new VIPBrowserLibrary.BBS.MachiBBS.MachiBBSThreadReader(url);
                break;

            default:
                throw new NotSupportedException();
            }

            string dat = itr.OfflineGetResponse();

            this.Tag        = itr.ResSets;
            this.ThreadData = itr.ThreadInfo;
            this.ThreadName = itr.ThreadName;
            return(dat);
        }
Пример #3
0
        /// <summary>
        /// Dictionary形式のレスデータをRes構造体に変換します
        /// </summary>
        /// <param name="data">変換するデータ</param>
        /// <param name="bt">変換元の板の帰属元</param>
        /// <returns>変換したRes構造体</returns>
        public Chron.ThreadOrResData.Res ParseDictionaryToRes(Dictionary <string, string> data, VIPBrowserLibrary.Common.BBSType bt)
        {
            Chron.ThreadOrResData.Res r;
            switch (bt)
            {
            case VIPBrowserLibrary.Common.BBSType._2ch:
            {
                r = new Chron.ThreadOrResData.Res(1, data["FROM"], data["mail"], data["MESSAGE"], "SampleID", "2013/11/16 21:47:59.02", "BE", true);
            }
            break;

            case VIPBrowserLibrary.Common.BBSType.jbbs:
            {
                r = new Chron.ThreadOrResData.Res(1, data["NAME"], data["MAIL"], data["MESSAGE"], "SampleKey", "2013/11/16 21:47:59.02", "BE", true);
            }
            break;

            case VIPBrowserLibrary.Common.BBSType.machibbs:
            {
                throw new NotSupportedException();
                //r = new Chron.ThreadOrResData.Res(0, data[""], data[""], data[""], data[""], data[""], data[""], true);
            }

            default:
                throw new ArgumentException();
            }
            return(r);
        }