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
Member_2_7967119Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AndyAinscowFreelance programmer / ConsultantCommented:
>> but the converted file is not compiling.

Letting us know the errors you get would help.
0
Member_2_7967119Author 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)
0
HainKurtSr. System AnalystCommented:
try

Dim sslFailureCallback = New RemoteCertificateValidationCallback(Function() True)
ServicePointManager.ServerCertificateValidationCallback += sslFailureCallback

Open in new window


http://converter.telerik.com/
1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

anarki_jimbelSenior DeveloperCommented:
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

0
anarki_jimbelSenior DeveloperCommented:
It was late! :D
0
Member_2_7967119Author Commented:
Let me try and revert back
0
anarki_jimbelSenior DeveloperCommented:
This question has been inactive for 14 days. Two people gave the same solution. Points are awarded to the first given solution.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.