-1
나는 URL에서 JSON을 역 직렬화하지만 GUI는 여전히 차단됩니다 그리고 난 내가 순서를 작성해야합니까 얼마나 **C# 작업을 차단 UI
그것을 밖으로 정렬하는 방법을 모르는이 코드를 내가 뭔가를 게시 할 수 stackoverflow? "귀하의 게시물이 주로 코드 인 것 같습니다. 자세한 내용을 추가하십시오."
버튼 코드 :
private void button1_Click(object sender, EventArgs e)
{
var context = TaskScheduler.FromCurrentSynchronizationContext();
string RealmName = listBox1.Items[listBox1.SelectedIndex].ToString();
Task.Factory.StartNew(() => JsonManager.GetAuctionIndex().Fetch(RealmName)
.ContinueWith(t =>
{
bool result = t.Result;
if (result)
{
label1.Text = JsonManager.GetAuctionIndex().LastUpdate + " ago";
foreach (string Owner in JsonManager.GetAuctionDump().Fetch(JsonManager.GetAuctionIndex().DumpURL))
{
listBox2.Items.Add(Owner);
}
}
},context));
}
기능 당신은 또한하여 웹 클라이언트에서 문자열 데이터를 다운로드 할 기다리고 있습니다 사용해야 당신의 Fetch
방법 내부 사전
일부 조정을 해 주셔서 감사합니다. DownloadStringAsync 대신 DownloadStringTaskAsync를 사용했습니다. – lorigio