I need convert code snippet c# to vb.net. I used the telerik converter, but it seems that automatic conversion is not possible. Someone can help how to implement a task and receive the result. C# code
public bool SendData(string key, string name, string mytext) { var mytask = Task.Run(() => Send(key, name, mytext)); var result = mytask.Result; return result; }
Public Function SendData(ByVal key As String, ByVal name As String, ByVal mytext As String) As Boolean Dim task = Task.Run(Function() Send(key, name, mytext)) Dim result = task.Result Return resultEnd Function
and since VB is not case sensitive, it is always better not to name a variable the same thing as an object (ie task vs Task).