VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,827 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
How can I convert the Following Code into code that uses async and await?
`Public Function GetFileText()`
Return File.ReadAllLines(FileItemListPath)
End Function
Dim ListLines() As String = GetFileText()
Try this:
Public Async Function GetFileTextAsync() As Task(Of String())
Return Await File.ReadAllLinesAsync(FileItemListPath)
End Function
' usage inside an Async function:
Dim ListLines As String() = Await GetFileTextAsync()