Click here to Skip to main content
16,004,678 members
Home / Discussions / C#
   

C#

 
Questioncould somebody help me? Pin
Chrislangton17-Mar-05 19:31
Chrislangton17-Mar-05 19:31 
AnswerRe: could somebody help me? Pin
Colin Angus Mackay17-Mar-05 23:02
Colin Angus Mackay17-Mar-05 23:02 
AnswerRe: could somebody help me? Pin
Sebastian Schneider18-Mar-05 2:34
Sebastian Schneider18-Mar-05 2:34 
Generalview html Pin
frankDust17-Mar-05 19:26
frankDust17-Mar-05 19:26 
Question.NET FRAMEWORK BUG? Pin
reflex@codeproject17-Mar-05 18:22
reflex@codeproject17-Mar-05 18:22 
AnswerRe: .NET FRAMEWORK BUG? Pin
MoustafaS18-Mar-05 12:54
MoustafaS18-Mar-05 12:54 
GeneralRe: .NET FRAMEWORK BUG? Pin
reflex@codeproject18-Mar-05 16:06
reflex@codeproject18-Mar-05 16:06 
QuestionCan somebody help me make sense of this? Pin
hstock17-Mar-05 18:04
hstock17-Mar-05 18:04 
I was reading the article C# Server Enumerator By Phil Bolduc

because I am trying to figure out how to build a database connection dialog for an application that should be flexible about which database server and which database I connect to.

My problem is that the sampe code does not run....

If there is a Network Managment namespace somewhere, I don't know where to find it.

I realized this snippet was not comlete because there was no main method, but that is not all that is wrong. Can anybody point out where I am going wrong?
Sigh | :sigh:
// His code here...======================================================
using System;
using NetworkManagement;

//
// List all the SQL Server database to the
// console (using foreach)
//
Servers servers = new Servers( ServerType.SQLServer );
foreach (String name in servers)
{
Console.WriteLine(name);
}

//
// List all the Domains to the console.
//
Servers servers = new Servers( ServerType.DomainEnum );
IEnumerator i = servers.GetEnumerator()

while ( i.MoveNext() )
{
string domainName = (string) i.Current;
Console.WriteLine(domainName);
}
// My code here... ==========================================

using System;
using NetworkManagement;


namespace ConsoleApplication2
{
///
/// Summary description for Class1.
///

class Class1
{
Servers servers = new Servers( ServerType.SQLServer );
///
/// The main entry point for the application.
///

[STAThread]
static void Main(string[] args)
{

//
// List all the SQL Server database to the
// console (using foreach)
//
foreach (String name in servers)
{
Console.WriteLine(name);
}

//
// List all the Domains to the console.
//
Servers servers = new Servers( ServerType.DomainEnum );
IEnumerator i = servers.GetEnumerator()

while ( i.MoveNext() )
{
string domainName = (string) i.Current;
Console.WriteLine(domainName);
}

}
}
}
AnswerRe: Can somebody help me make sense of this? Pin
Colin Angus Mackay17-Mar-05 23:07
Colin Angus Mackay17-Mar-05 23:07 
QuestionHow to deploy web application Pin
ABBASI_RA17-Mar-05 17:12
ABBASI_RA17-Mar-05 17:12 
AnswerRe: How to deploy web application Pin
Kodanda Pani17-Mar-05 20:34
Kodanda Pani17-Mar-05 20:34 
AnswerRe: How to deploy web application Pin
V.17-Mar-05 21:32
professionalV.17-Mar-05 21:32 
GeneralListView Control Pin
cjdlv17-Mar-05 15:56
cjdlv17-Mar-05 15:56 
GeneralRe: ListView Control Pin
cjdlv17-Mar-05 17:01
cjdlv17-Mar-05 17:01 
GeneralC# call VC++ console DLL Pin
LeeeNN17-Mar-05 13:08
LeeeNN17-Mar-05 13:08 
GeneralRe: C# call VC++ console DLL Pin
Heath Stewart17-Mar-05 14:28
protectorHeath Stewart17-Mar-05 14:28 
GeneralRe: regex exclusion Pin
Christian Graus17-Mar-05 12:43
protectorChristian Graus17-Mar-05 12:43 
GeneralRe: regex exclusion Pin
Anonymous17-Mar-05 13:05
Anonymous17-Mar-05 13:05 
GeneralRe: regex exclusion Pin
Anonymous17-Mar-05 13:10
Anonymous17-Mar-05 13:10 
GeneralRe: regex exclusion Pin
Anonymous17-Mar-05 13:14
Anonymous17-Mar-05 13:14 
GeneralRe: regex exclusion Pin
mav.northwind17-Mar-05 19:25
mav.northwind17-Mar-05 19:25 
GeneralRe: regex exclusion Pin
Anonymous17-Mar-05 23:23
Anonymous17-Mar-05 23:23 
GeneralRe: regex exclusion Pin
Anonymous17-Mar-05 23:26
Anonymous17-Mar-05 23:26 
Generalregex exclusion Pin
Anonymous17-Mar-05 11:48
Anonymous17-Mar-05 11:48 
GeneralRe: regex exclusion Pin
Christian Graus17-Mar-05 11:59
protectorChristian Graus17-Mar-05 11:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.