using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace weipai
{
public partial class Form1 : Form
{
private delegate string GetCustomerListHandler();
// Delegate Function GetCustomerListHandler(State As String) As String()
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
GetCustomerListHandler handler1 = new GetCustomerListHandler(GetCustomerList);
//handler1 = GetCustomerList();
System.IAsyncResult a = handler1.BeginInvoke(null, null);
if (a.IsCompleted)
{
MessageBox.Show(handler1.EndInvoke(a));
}
}
string GetCustomerList()
{
while (true)
{
string times = Convert.ToString(DateTime.Now.Hour);
if (times == "7")
{
MessageBox.Show("ok!!!!!");
return "a";
}
}
}
}
}