Exemplo n.º 1
0
 static void Main(string[] args)
 {
     using (FileReaderClient proxy = new FileReaderClient())
     {
         Console.WriteLine("文件内容:{0}", proxy.Read("HelloWorld.txt"));
     }
     Console.Read();
 }
 private static void TestJustStartServiceHostByWinService()
 {
     using (FileReaderClient proxy = new FileReaderClient())
     {
         proxy.JustStart("", "crawl");
     }
     Console.Read();
 }
Exemplo n.º 3
0
 static void Main(string[] args)
 {
     using (var proxy =new FileReaderClient())
     {
      
         Console.WriteLine("文件内容:{0}", proxy.Read("HelloWorld.txt"));
     }
     Console.Read();
 }
Exemplo n.º 4
0
        private void SetThreadDataFromKeyword(string keyword)
        {
            FileReaderClient client = ReferenceCreater.GetFileReaderClient();
            var rdataset            = client.Open掲示板データキーワード検索(keyword, ddlスレッド選択.SelectedValue);

            rdataset.作成グループNo = 1; // キーワード検索では1を返すことにする。//本来ならば、svc側に書くべきだが。やっつけで。

            SetThreadData(rdataset);

            // SessionにIsSearchDataを格納
            // クリアのタイミングは、新規投稿・掲示板ボタンクリック、在庫管理クリック、スレッド移動の時、返信画面で投稿した時
            Session["IsSearchData"] = true;
        }
 private static void TestService()
 {
     using (FileReaderClient proxy = new FileReaderClient())
     {
         string addPatchStr = proxy.Read("demo.txt");
         Console.WriteLine(DateTime.Now.ToShortDateString() + ": Account + :{0}", addPatchStr);
         double addPatch = 0.00;
         if (double.TryParse(addPatchStr, out addPatch))
         {
             int    days    = ((DateTime.Now - new DateTime(2012, 10, 1)).Days);
             string content = (days * addPatch).ToString();
             proxy.Write("demo.txt", content);
         }
     }
     Console.Read();
 }
Exemplo n.º 6
0
        //protected void btnAdd_Click(object sender, System.EventArgs e)
        //{

        //    List<FileUpload> fuList = new List<FileUpload>();
        //    fuList = Session["fuList"] as List<FileUpload>;

        //    if (fuList == null)
        //    {
        //        fuList = new List<FileUpload>();
        //    }

        //    FileUpload fu = new FileUpload();
        //    fuList.Add(fu);
        //    Session["fuList"] = fuList;

        //    foreach (var f in fuList)
        //    {
        //        Panel2.Controls.Add(f);
        //    }
        //}


        protected void btn処理送信_Click(object sender, System.EventArgs e)
        {
            Button btn = sender as Button;

            if (btn == null)
            {
                return;
            }

            if (tb記事No.Text == "")
            {
                return;
            }

            if (tb処理暗証キー.Text == "")
            {
                return;
            }


            // 修正処理
            if (ddl処理.SelectedIndex == 0)
            {
                // パスワード確認
                FileReaderClient client = ReferenceCreater.GetFileReaderClient();
                var rEnt = client.掲示板記事修正確認チェック(ddlスレッド選択.SelectedValue, tb記事No.Text, tb処理暗証キー.Text, false);
                if (!rEnt.暗証キーチェック成功 || rEnt.エラーメッセージ != null)
                {
                    return;
                }

                Session["修正用記事データ"] = rEnt.記事データ;
                // Kubun = Mod : Modify
                Response.Redirect("Contributer.aspx?ThreadName=" + ddlスレッド選択.SelectedValue + "&No=" + tb記事No.Text + "&Kubun=Mod");
            }
            // 削除処理
            else if (ddl処理.SelectedIndex == 1)
            {
                FileWriterClient client2 = ReferenceCreater.GetFileWriterClient();
                var 結果メッセージ = client2.掲示板データ削除(ddlスレッド選択.SelectedValue, tb記事No.Text, tb処理暗証キー.Text, false);

                //string script =
                //                "<script language=javascript>" +
                //                "window.alert('" + 結果メッセージ + "')" +
                //                "</script>";
                //Response.Write(script);

                // Redirect後のMessageShow
                MessageShowEntity mse = new MessageShowEntity();
                mse.Message            = 結果メッセージ;
                Session["ShowMessage"] = mse;
            }
            else
            {
                return;
            }


            // Redirect用のセッション
            Session["IsRedirectFromContribute"] = 1;
            Session["ThreadName"] = Request.QueryString["ThreadName"];

            // 掲示板画面へ遷移
            Response.Redirect("BBS.aspx");
        }