Link to home
Start Free TrialLog in
Avatar of Member_2_7967119
Member_2_7967119

asked on

Help with Converting C# to vb

I have used couple of free ware to convert C# to Vb but the converted file is not compiling.

Could I get some help with have the C# file (attached) converted to Vb and also it should be working.

I am using ASP.net and VB environment.
TestDataC.txt
Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland image

>> but the converted file is not compiling.

Letting us know the errors you get would help.
Avatar of Member_2_7967119
Member_2_7967119

ASKER

the following statement

 var sslFailureCallback = new RemoteCertificateValidationCallback(delegate { return true; });
            ServicePointManager.ServerCertificateValidationCallback += sslFailureCallback;

is being converted to

Dim sslFailureCallback As var = New RemoteCertificateValidationCallback(delegate, {, true)
UnknownUnknownServicePointManager.ServerCertificateValidationCallback = (ServicePointManager.ServerCertificateValidationCallback + sslFailureCallback)
ASKER CERTIFIED SOLUTION
Avatar of HainKurt
HainKurt
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The line
Dim sslFailureCallback As var = New RemoteCertificateValidationCallback(delegate, {, true)

Open in new window

is definitely wrong: some strange commas, unclosed braces...

May be something like below?

Dim sslFailureCallback = New RemoteCertificateValidationCallback(Function() True)

Open in new window

It was late! :D
Let me try and revert back
This question has been inactive for 14 days. Two people gave the same solution. Points are awarded to the first given solution.