«前の日記(2007-02-14) 最新 次の日記(2007-02-16)» 編集

ToDo:

  • 99 深呼吸して、おちけつ (~12/31 あと287日)
  • 98 毎日アウトプットを重きにおいた目標をたてる (~12/31 あと287日)
  • 97 買物は行動を変えるもの・ことに限る (~12/31 あと287日)
  • 96 合理的な行動はときに我慢を強いる(~12/31 あと287日)

ɥozɐʞıɥ


2007-02-15 力みすぎ [長年日記]

_ 本日

ちょっとお子ちゃま相手に力み杉田かも。ハソセイ。

お馬鹿の相手は程々にですな。

_ [C#] Delegateによる非同期Thread

参考
 using System;
 using System.Collections.Generic;
 using System.Text;
 using System.Threading;
 
 namespace DelegateTest
 {
    delegate void Delegatefunction(string str,int cnt);
    class Program
    {
        static void Main(string[] args)
        {
            Program prog = new Program();
            Delegatefunction func = new Delegatefunction(prog.CallerFunction);
            func.BeginInvoke("Delegate", 1000,new AsyncCallback(prog.Callback), func);
            prog.CallerFunction("Main",2000);
        }
 
        public void CallerFunction(string str,int cnt)
        {
            for (int i = 0; i < 10; i++)
            {
                Thread.Sleep(cnt);
                System.Console.WriteLine(str + ":" + i);
            }
        }
 
        public void Callback(IAsyncResult ar)
        {
            // 後始末
            Delegatefunction func = (Delegatefunction)ar.AsyncState;
            func.EndInvoke(ar);
        }
    }
 }


2002|09|10|11|12|
2003|01|02|03|04|05|06|07|08|09|10|11|12|
2004|01|02|03|04|05|06|07|08|09|10|11|12|
2005|01|02|03|04|05|06|07|08|09|10|11|12|
2006|01|02|03|04|05|06|07|08|09|10|11|12|
2007|01|02|03|04|05|06|07|08|09|10|11|12|
2008|01|02|03|04|05|06|07|08|09|10|11|12|
2009|01|02|03|04|05|06|07|08|09|10|11|12|
2010|01|02|03|04|05|06|07|08|09|10|11|12|
2011|01|02|03|04|05|06|07|08|09|10|11|12|
2012|01|02|03|04|05|06|07|08|09|10|11|12|
2013|01|02|03|04|05|06|07|08|09|10|11|12|
2014|01|02|03|04|05|06|07|08|09|10|11|12|
2015|01|02|03|04|05|06|07|08|09|10|11|12|
2016|01|02|03|04|05|06|07|08|09|10|11|12|
2017|01|02|03|04|05|06|07|08|09|10|11|12|
2018|01|02|03|04|05|06|07|08|09|10|11|12|
2019|01|02|03|04|05|06|07|08|09|10|11|12|
2020|01|02|03|
«前の日記(2007-02-14) 最新 次の日記(2007-02-16)» 編集