Click here to Skip to main content
15,898,035 members
Home / Discussions / C#
   

C#

 
AnswerRe: two titles on title bar Pin
Harvey Saayman20-Jan-10 19:45
Harvey Saayman20-Jan-10 19:45 
GeneralRe: two titles on title bar Pin
Jassim Rahma21-Jan-10 12:10
Jassim Rahma21-Jan-10 12:10 
QuestionConvert string to nullable int Pin
John_1020-Jan-10 2:35
John_1020-Jan-10 2:35 
AnswerRe: Convert string to nullable int Pin
EliottA20-Jan-10 2:43
EliottA20-Jan-10 2:43 
AnswerRe: Convert string to nullable int [modified] Pin
Keith Barrow20-Jan-10 2:51
professionalKeith Barrow20-Jan-10 2:51 
AnswerRe: Convert string to nullable int PinPopular
Nuri Ismail20-Jan-10 2:52
Nuri Ismail20-Jan-10 2:52 
QuestionWeb service to receive a pdf file as MIME attachment Pin
Gktony20-Jan-10 2:12
Gktony20-Jan-10 2:12 
QuestionConnections options in C# Pin
vinothkumar_Dhakshinamoorthy20-Jan-10 2:04
vinothkumar_Dhakshinamoorthy20-Jan-10 2:04 
Hi,
In my program i'm trying to access a server drives details from my machine with different username and password, for this i'm using the connections options class in C#,
here is the code i'm using

try
{
ConnectionOptions opt = new ConnectionOptions("MS_409", "USERNAME", "PASSWORD", "ntdlmdomain:DOMAIN", ImpersonationLevel.Impersonate, AuthenticationLevel.Default,false, null, TimeSpan.MaxValue);
ObjectQuery query = new ObjectQuery("SELECT FreeSpace, Name FROM Win32_LogicalDisk WHERE DriveType = 3");
ManagementScope scope = new ManagementScope("\\\\" + "16.106.64.108" + "\\root\\cimv2", opt);
ManagementObjectSearcher searcher = new ManagementObjectSearcher(scope, query);
ManagementObjectCollection coll = searcher.Get();

foreach (ManagementObject ms in coll)
{
Console.WriteLine(ms["Name"]);
Console.WriteLine(Convert.ToDecimal(ms["FreeSpace"]) / 1024 / 1024 / 1024);
}
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}

whenever i reach line "ManagementObjectCollection coll = searcher.Get();" i'm getting the "Invalid Parameter" error, i could not find a slution for this, please help.

Thanks,
D.Vinoth Frown | :(
AnswerRe: Connections options in C# Pin
Covean20-Jan-10 2:49
Covean20-Jan-10 2:49 
GeneralRe: Connections options in C# Pin
vinothkumar_Dhakshinamoorthy20-Jan-10 4:21
vinothkumar_Dhakshinamoorthy20-Jan-10 4:21 
Questionadding an icon to desktop in setup and deployment project Pin
samy10020-Jan-10 0:59
samy10020-Jan-10 0:59 
AnswerRe: adding an icon to desktop in setup and deployment project Pin
daxfrost20-Jan-10 1:43
daxfrost20-Jan-10 1:43 
AnswerRe: adding an icon to desktop in setup and deployment project Pin
Nuri Ismail20-Jan-10 1:52
Nuri Ismail20-Jan-10 1:52 
QuestionC# and LISP comparison Pin
gamer112720-Jan-10 0:59
gamer112720-Jan-10 0:59 
AnswerRe: C# and LISP comparison Pin
SeMartens20-Jan-10 1:16
SeMartens20-Jan-10 1:16 
QuestionSetForegroundWindow Pin
sucil20-Jan-10 0:24
sucil20-Jan-10 0:24 
AnswerRe: SetForegroundWindow Pin
daxfrost20-Jan-10 0:31
daxfrost20-Jan-10 0:31 
QuestionExport datagrid to excel or csv Pin
codenoobie19-Jan-10 23:55
codenoobie19-Jan-10 23:55 
AnswerRe: Export datagrid to excel or csv Pin
sanforjackass20-Jan-10 1:01
sanforjackass20-Jan-10 1:01 
GeneralRe: Export datagrid to excel or csv Pin
codenoobie20-Jan-10 1:24
codenoobie20-Jan-10 1:24 
QuestionXmlSerializer - usage within constructors Pin
lukeer19-Jan-10 23:07
lukeer19-Jan-10 23:07 
AnswerRe: XmlSerializer - usage within constructors Pin
Covean19-Jan-10 23:51
Covean19-Jan-10 23:51 
QuestionReturning a parameter from a stored proc Pin
jamesc6919-Jan-10 22:31
jamesc6919-Jan-10 22:31 
AnswerRe: Returning a parameter from a stored proc Pin
Bardy8519-Jan-10 23:05
Bardy8519-Jan-10 23:05 
GeneralRe: Returning a parameter from a stored proc Pin
J a a n s19-Jan-10 23:15
professionalJ a a n s19-Jan-10 23:15 

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.