新しいスレッドで呼び出されるメソッド「ImportExcel」があります。
[STAThread]
private void btnImportExcel_Click(object sender, EventArgs e)
{
// Start by setting up a new thread using the delegate ThreadStart
// We tell it the entry function (the function to call first in the thread)
// Think of it as main() for the new thread.
ThreadStart theprogress = new ThreadStart(ImportExcel);
// Now the thread which we create using the delegate
Thread startprogress = new Thread(theprogress);
startprogress.SetApartmentState(ApartmentState.STA);
// We can give it a name (optional)
startprogress.Name = "Book Detail Scrapper";
// Start the execution
startprogress.Start();
}
ImportExcel() 関数内に、try catch ブロックがあります。catch ブロックでは、特定の例外が発生した場合、ImportExcel() 関数を再度呼び出したいと考えています。それ、どうやったら出来るの?