AccessTr.neT

Tam Versiyon: Uzun Süren İşlemlerde Kodların Birbirini Beklemesi
Şu anda arşiv modunu görüntülemektesiniz. Tam versiyonu görüntülemek için buraya tıklayınız.
Sayfalar: 1 2 3 4 5 6 7
bir işlem tamamlanmadan diğerine geçmemesi için ne kullanabilirim
bu uygun bir kod mudur


' Three things to note about writing an Async Function:
'  - The function has an Async modifier.
'  - Its return type is Task or Task(Of T). (See "Return Types" section.)
'  - As a matter of convention, its name ends in "Async".
Async Function AccessTheWebAsync() As Task(Of Integer)
    Using client As New HttpClient()
        ' Call and await separately.
        '  - AccessTheWebAsync can do other things while GetStringAsync is also running.
        '  - getStringTask stores the task we get from the call to GetStringAsync.
        '  - Task(Of String) means it is a task which returns a String when it is done.
        Dim getStringTask As Task(Of String) =
            client.GetStringAsync("https://docs.microsoft.com/dotnet")
        ' You can do other work here that doesn't rely on the string from GetStringAsync.
        DoIndependentWork()
        ' The Await operator suspends AccessTheWebAsync.
        '  - AccessTheWebAsync does not continue until getStringTask is complete.
        '  - Meanwhile, control returns to the caller of AccessTheWebAsync.
        '  - Control resumes here when getStringTask is complete.
        '  - The Await operator then retrieves the String result from getStringTask.
        Dim urlContents As String = Await getStringTask
        ' The Return statement specifies an Integer result.
        ' A method which awaits AccessTheWebAsync receives the Length value.
        Return urlContents.Length

    End Using

End Function
(04/02/2020, 22:54)accessman yazdı: [ -> ]bir işlem tamamlanmadan diğerine geçmemesi için ne kullanabilirim
Sleep gibi api ile zamanlı durdurulur yada unuttum application.wait gibi kodlar vardı belki öyle olabilir yada stop eklenir koda oraya gelince durur gibi Img-grin
benim istediğim işlem bitene kadar beklesin yani süre sabit değil
Üstad bir politikacıları birde sizi bazen anlamıyorum Img-grin
Tam olarak ne olacak.örnek açıklama yaparsanız uzmanlar belki çözer beni aşar sanıyorum bu durum.
eklediğim örnek bunun için mi (v=rv9Abgjt8kI)
Sayfalar: 1 2 3 4 5 6 7