In Progress

C# TO VB.NET

I would like to translate this into vb.net. Trying to leanr how to use the wmi .net [url removed, login to view] providore. But i am haveing a hard time finding vb.net examples. using System; using [url removed, login to view]; using [url removed, login to view]; using [url removed, login to view]; using [url removed, login to view]; using [url removed, login to view]; using [url removed, login to view]; using [url removed, login to view]; using [url removed, login to view]; 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 { [url removed, login to view](); ManagementObjectSearcher searcher = new ManagementObjectSearcher(scope, new ObjectQuery( "select Name from IIsWebServerSetting where ServerComment=\"" + serverComment + """)); ManagementObjectCollection coll = [url removed, login to view](); [url removed, login to view] enumerator = [url removed, login to view](); [url removed, login to view](); ManagementBaseObject cur = [url removed, login to view]; string serverName = (string) [url removed, login to view]["Name"].Value; ManagementObject iisSite = new ManagementObject( scope,new ManagementPath("IIsWebServer='"+serverName+"'"),null); [url removed, login to view]("start",new object[0]); return "Started"; } catch (Exception e) { return "Failed to connect: " + [url removed, login to view]; } } // 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 { [url removed, login to view](); ManagementObjectSearcher searcher = new ManagementObjectSearcher(scope, new ObjectQuery( "select Name from IIsWebServerSetting where ServerComment=\"" + serverComment + """)); ManagementObjectCollection coll = [url removed, login to view](); [url removed, login to view] enumerator = [url removed, login to view](); [url removed, login to view](); ManagementBaseObject cur = [url removed, login to view]; string serverName = (string) [url removed, login to view]["Name"].Value; ManagementObject iisSite = new ManagementObject( scope,new ManagementPath("IIsWebServer='"+serverName+"'"),null); return states[(int)[url removed, login to view]("ServerState")]; } catch (Exception e) { return("Failed to connect: " + [url removed, login to view]); } } } } This code in vb.net working.

## Platform

windows 2000-2003 server iis6

Skills: .NET, ASP, C Programming, C# Programming, Engineering, MySQL, PHP, Software Architecture, Software Testing, Visual Basic

See more: use of vb net, use in vb.net, how to use vb net, how to use in vb.net, how to string, how to get into management, how to code vb.net, how to code in vb net, get string c, finding net, c# system management, c get string, paused, e vb, c to vb.net, c to vb, wmi, vb to vb net, the net connect, net web services, how to start working, cur, c++ to, c to, net private

About the Employer:
( 8 reviews ) United States

Project ID: #3098748

Awarded to:

danesolutions

See private message.

$1 USD in 10 days
(118 Reviews)
7.8

5 freelancers are bidding on average $23 for this job

sawamu

See private message.

$8.5 USD in 10 days
(215 Reviews)
5.9
sissoftware

See private message.

$85 USD in 10 days
(18 Reviews)
4.9
sdotnetcoder

See private message.

$8.5 USD in 10 days
(11 Reviews)
2.2
TheDev

See private message.

$12.75 USD in 10 days
(4 Reviews)
2.1