如何将以下C#代码转换为VB.NET?
private static readonly ICollection<string>
_skipHeaders = new[]
{
"Connection",
"Keep-Alive",
"Accept",
"Host",
"User-Agent",
"Content-Length",
"Content-Type",
"Accept-Encoding",
"Authorization",
"Referer",
ProxyMethodHeader,
ProxyAuthorizationHeader,
ProxyAcceptHeader,
ProxyAgentHeader,
ProxyQueryHeader
};
答案 0 :(得分:7)
以下内容适用于vb9
Private Shared _skipHeaders as ICollection(Of String) = New String() { _
"Connection", _
"Keep-Alive", _
... }
答案 1 :(得分:2)
Private Shared ReadOnly _skipHeaders As ICollection(Of String) = New ()
{"Connection", "Keep-Alive", "Accept", "Host", "User-Agent", "Content-Length", "Content-Type", "Accept-Encoding", "Authorization", "Referer", ProxyMethodHeader, ProxyAuthorizationHeader, ProxyAcceptHeader, ProxyAgentHeader, ProxyQueryHeader}
答案 2 :(得分:1)
我赞成JaredPar的答案,因为它是正确的。为了将来参考,http://www.developerfusion.com/tools/convert/csharp-to-vb/有一个很棒的转换工具。