Translate this code from C # to VB.NET

How do you convert the following C # code to 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 }; 
+4
source share
3 answers

The following will work for vb9

 Private Shared _skipHeaders as ICollection(Of String) = New String() { _ "Connection", _ "Keep-Alive", _ ... } 
+7
source
 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
source

I supported JaredPar's answer because it is correct. For future reference, there is an excellent conversion tool here http://www.developerfusion.com/tools/convert/csharp-to-vb/ .

+1
source

Source: https://habr.com/ru/post/1304926/


All Articles