Avatar of 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.
ASP.NETC#.NET Programming

Avatar of undefined
Last Comment
Dmitry G

8/22/2022 - Mon

>> but the converted file is not compiling.

Letting us know the errors you get would help.

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)

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Dmitry G

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

Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Dmitry G

It was late! :D

Let me try and revert back
Dmitry G

This question has been inactive for 14 days. Two people gave the same solution. Points are awarded to the first given solution.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.