gpt4 book ai didi

VB.NET 如何添加返回属性?

转载 作者:行者123 更新时间:2023-12-01 15:30:19 24 4
gpt4 key购买 nike

我正在将 C# 代码转换为 VB.Net,C 代码在函数上方有这个:

[return: System.Xml.Serialization.XmlElementAttribute("Name", IsNullable=true)]

最佳答案

给定此 C# 代码:

public [return:XmlElement("Name", IsNullable=true)] string Foo()
{
return "";
}

将翻译成类似的东西:

Public Function Foo() As <XmlElement("Name", IsNullable := True)> String
Return ""
End Function

关于VB.NET 如何添加返回属性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1509756/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com