We help IT Professionals succeed at work.

Help with Converting C# to vb

80 Views
Last Modified: 2017-05-06
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
Comment
Watch Question

AndyAinscowFreelance programmer / Consultant
CERTIFIED EXPERT

Commented:
>> but the converted file is not compiling.

Letting us know the errors you get would help.

Author

Commented:
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)
Sr. System Analyst
CERTIFIED EXPERT
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION
Dmitry GSenior Developer
CERTIFIED EXPERT

Commented:
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

Dmitry GSenior Developer
CERTIFIED EXPERT

Commented:
It was late! :D

Author

Commented:
Let me try and revert back
Dmitry GSenior Developer
CERTIFIED EXPERT

Commented:
This question has been inactive for 14 days. Two people gave the same solution. Points are awarded to the first given solution.