Click here to Skip to main content
15,911,890 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have C# code, but while converting it to vb.net (using online convertor) is giving me error.

C# code is :
await client.SendAsync(new TLI() {user_id = user.id}, "MESSAGE");


and the converted code is :
Await client.SendAsync(New TLI() With {Key .user_id = user.id}, "MESSAGE")


what is Key in the converted code. vb.net say it an error. Can anyone explain me the concept?

What I have tried:

I'm not able to understand the c# code.
Posted
Updated 19-May-17 1:10am

I think you need to do something like this:
VB
Dim temp as new TLI
temp.user_id = user.id
Await client.SendAsync(temp, "MESSAGE")
As I am used to C#, I can not tell you if this is the exact syntax.
 
Share this answer
 
I found the answer - Just remove the Key
Await client.SendAsync(New TLI() With {.user_id = user.id}, "MESSAGE")
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900