Find Jobs
Hire Freelancers

C# TO VB.NET

$30-5000 USD

In Progress
Posted over 20 years ago

$30-5000 USD

Paid on delivery
I would like to translate this into vb.net. Trying to leanr how to use the wmi .net [login to view URL] providore. But i am haveing a hard time finding vb.net examples. using System; using [login to view URL]; using [login to view URL]; using [login to view URL]; using [login to view URL]; using [login to view URL]; using [login to view URL]; using [login to view URL]; using [login to view URL]; namespace MyIis6ControlNamespace { public class MyIis6ControlObject : WebService { // standard VS-generated code deleted for clarity [WebMethod] [SoapRpcMethod] public string start(string serverComment) { ManagementScope scope = new ManagementScope("root\\MicrosoftIISv2"); try { [login to view URL](); ManagementObjectSearcher searcher = new ManagementObjectSearcher(scope, new ObjectQuery( "select Name from IIsWebServerSetting where ServerComment=\"" + serverComment + """)); ManagementObjectCollection coll = [login to view URL](); [login to view URL] enumerator = [login to view URL](); [login to view URL](); ManagementBaseObject cur = [login to view URL]; string serverName = (string) [login to view URL]["Name"].Value; ManagementObject iisSite = new ManagementObject( scope,new ManagementPath("IIsWebServer='"+serverName+"'"),null); [login to view URL]("start",new object[0]); return "Started"; } catch (Exception e) { return "Failed to connect: " + [login to view URL]; } } // stop is just like start except that the name of the method to invoke is "stop" private static string [] states = {"","starting","started","stopping", "stopped","pausing","paused","continuing"}; ## Deliverables [WebMethod] [SoapRpcMethod] public string state(string serverComment) { ManagementScope scope = new ManagementScope("root\\MicrosoftIISv2"); try { [login to view URL](); ManagementObjectSearcher searcher = new ManagementObjectSearcher(scope, new ObjectQuery( "select Name from IIsWebServerSetting where ServerComment=\"" + serverComment + """)); ManagementObjectCollection coll = [login to view URL](); [login to view URL] enumerator = [login to view URL](); [login to view URL](); ManagementBaseObject cur = [login to view URL]; string serverName = (string) [login to view URL]["Name"].Value; ManagementObject iisSite = new ManagementObject( scope,new ManagementPath("IIsWebServer='"+serverName+"'"),null); return states[(int)[login to view URL]("ServerState")]; } catch (Exception e) { return("Failed to connect: " + [login to view URL]); } } } } This code in vb.net working. ## Platform windows 2000-2003 server iis6
Project ID: 3098748

About the project

5 proposals
Remote project
Active 20 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
See private message.
$1 USD in 10 days
5.0 (118 reviews)
7.8
7.8
5 freelancers are bidding on average $23 USD for this job
User Avatar
See private message.
$8.50 USD in 10 days
4.9 (215 reviews)
5.9
5.9
User Avatar
See private message.
$85 USD in 10 days
4.9 (18 reviews)
4.9
4.9
User Avatar
See private message.
$8.50 USD in 10 days
4.9 (11 reviews)
2.2
2.2
User Avatar
See private message.
$12.75 USD in 10 days
3.9 (4 reviews)
2.1
2.1

About the client

Flag of UNITED STATES
United States
5.0
8
Member since Dec 12, 2002

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.