C#对VB.NET的转换存在疑问 [英] C# to VB.NET conversion doubt
本文介绍了C#对VB.NET的转换存在疑问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有C#代码,但在将其转换为vb.net(使用在线转换器)时却给了我错误。
C#代码是:
await client.SendAsync(new TLI(){user_id = user.id},MESSAGE);
和转换后的代码是:
等待客户。 SendAsync(新TLI()使用{Key .user_id = user.id},MESSAGE)
什么是转换中的Key码。 vb.net说这是一个错误。任何人都可以向我解释这个概念吗?
我的尝试:
我无法理解c#代码。
解决方案
我认为你需要这样做:
Dim temp as new TLI
temp.user_id = user.id
Await client.SendAsync(temp, MESSAGE)因为我已经习惯了C#,所以我不能告诉你这是否是确切的语法。
我找到了答案 - 只需删除密钥
Await client.SendAsync(New TLI()With {.user_id = user.id}, MESSAGE)
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.
解决方案
I think you need to do something like this:
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.
I found the answer - Just remove the Key
Await client.SendAsync(New TLI() With {.user_id = user.id}, "MESSAGE")
这篇关于C#对VB.NET的转换存在疑问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文