我有这样的代码:C#线程,性能第二部分
public partial class FrmPrincipal : Form
{
private Image imagen;
public FrmPrincipal()
{
InitializeComponent();
...
}
private void menuItem1_Click(object sender, EventArgs e)
{
Thread t = new Thread(RequestImage);
t.Start();
}
private void RequestImage()
{
try
{
...
// I want to update this.token
this.imagen = retrieveImageFromWebService();
...
}
catch (Exception ex)
{
...
}
}
}
如何更新图像?我想保存图像的副本,以便在用户需要时更新pictureBox。
谢谢!
什么问题到底?如果我没有弄错,该代码应该运行良好。 – Noldorin 2009-02-20 16:02:36
你的意思是,“我如何从另一个线程更新令牌”? – Richard 2009-02-20 16:05:34