Click here to Skip to main content
15,888,461 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to get the SELECT SCOPE_IDENTITY() - alternative Pin
Ennis Ray Lynch, Jr.6-Mar-09 17:08
Ennis Ray Lynch, Jr.6-Mar-09 17:08 
GeneralRe: How to get the SELECT SCOPE_IDENTITY() - alternative Pin
ziwez06-Mar-09 21:13
ziwez06-Mar-09 21:13 
GeneralRe: How to get the SELECT SCOPE_IDENTITY() - alternative Pin
Ennis Ray Lynch, Jr.7-Mar-09 6:34
Ennis Ray Lynch, Jr.7-Mar-09 6:34 
Questionbindingsource add new rec Pin
ABBASI_RA6-Mar-09 11:09
ABBASI_RA6-Mar-09 11:09 
AnswerRe: bindingsource add new rec Pin
Xmen Real 6-Mar-09 13:21
professional Xmen Real 6-Mar-09 13:21 
GeneralPersonal Tutor wanted to teach C#, Sharepoint Pin
keralaman6-Mar-09 9:41
keralaman6-Mar-09 9:41 
GeneralRe: Personal Tutor wanted to teach C#, Sharepoint Pin
Wes Aday6-Mar-09 10:05
professionalWes Aday6-Mar-09 10:05 
QuestionHow can i write a problem so the webpages comes to me Pin
netJP12L6-Mar-09 8:37
netJP12L6-Mar-09 8:37 
AnswerRe: How can i write a problem so the webpages comes to me Pin
Yusuf6-Mar-09 8:47
Yusuf6-Mar-09 8:47 
GeneralRe: How can i write a problem so the webpages comes to me Pin
Curtis Schlak.6-Mar-09 9:26
Curtis Schlak.6-Mar-09 9:26 
AnswerRe: How can i write a problem so the webpages comes to me Pin
Cybernate6-Mar-09 8:49
Cybernate6-Mar-09 8:49 
GeneralRe: How can i write a problem so the webpages comes to me Pin
Jim Crafton6-Mar-09 18:14
Jim Crafton6-Mar-09 18:14 
AnswerRe: How can i write a problem so the webpages comes to me Pin
WinSolution6-Mar-09 9:42
WinSolution6-Mar-09 9:42 
Questionmulti threaded tcp listeners possible Pin
Mubeen.asim6-Mar-09 7:40
Mubeen.asim6-Mar-09 7:40 
AnswerRe: multi threaded tcp listeners possible Pin
harold aptroot6-Mar-09 7:48
harold aptroot6-Mar-09 7:48 
GeneralRe: multi threaded tcp listeners possible Pin
Mubeen.asim6-Mar-09 8:00
Mubeen.asim6-Mar-09 8:00 
GeneralRe: multi threaded tcp listeners possible Pin
harold aptroot6-Mar-09 8:47
harold aptroot6-Mar-09 8:47 
GeneralRe: multi threaded tcp listeners possible Pin
caix7-Mar-09 16:08
caix7-Mar-09 16:08 
GeneralRe: multi threaded tcp listeners possible Pin
mcldev10-Mar-09 10:45
mcldev10-Mar-09 10:45 
GeneralRe: multi threaded tcp listeners possible Pin
Mubeen.asim10-Mar-09 21:21
Mubeen.asim10-Mar-09 21:21 
AnswerRe: multi threaded tcp listeners possible Pin
Ennis Ray Lynch, Jr.6-Mar-09 17:14
Ennis Ray Lynch, Jr.6-Mar-09 17:14 
QuestionWin32_CompurterSystem: Rename, JoinDomainOrWorkgroup, UnjoinDomainOrWorkgroup - HELP Pin
mcldev6-Mar-09 5:18
mcldev6-Mar-09 5:18 
AnswerRe: Win32_CompurterSystem: Rename, JoinDomainOrWorkgroup, UnjoinDomainOrWorkgroup - HELP Pin
Uros Calakovic6-Mar-09 10:09
Uros Calakovic6-Mar-09 10:09 
GeneralRe: Win32_CompurterSystem: Rename, JoinDomainOrWorkgroup, UnjoinDomainOrWorkgroup - HELP Pin
mcldev6-Mar-09 15:41
mcldev6-Mar-09 15:41 
The examples on MSDN are for Win32_Process and they work when I test. For some reason, Win32_ComputerSystem is behaving differently. I think there must a different way of calling the Win32_ComputerSystem functions. Here is the exact code that yields this result every time!

WTF | :WTF:
Exception caught!!!
System.Management: Invalid method Parameter(s)


public bool RenameComputer(string name, string password, string user)
 {
     bool ok = true;
     string mofName = "Rename";

     try
     {
         //Get an input parameters object for this method
         ManagementClass processClass = new ManagementClass("Win32_ComputerSystem");

         object[] methodArgs = { name, password, user};

         for (int i = 0; i < methodArgs.Length; ++i)
             Console.WriteLine("methodArgs[{0}] = {1}", i, methodArgs[i]);

         object retval = processClass.InvokeMethod(mofName, methodArgs);

         Console.WriteLine("InvokeMethod Status {0}, Process ID {1}",
             retval, methodArgs[3]);
     }
     catch (Exception e)
     {
         Console.WriteLine("Exception caught!!!");
         Console.WriteLine("{0}: {1}", e.Source, e.Message);
         ok = false;
     }
     return (ok);
 }


Has anyone been sucessful in calling Win32_ComputerSystem InvokeMethod() for Rename, or JoinDomainOrWorkgroup or UnjoinDomainOrWorkgroup. Help is greatly appreciated by me and anyone else dealing with this challenge.
GeneralRe: Win32_CompurterSystem: Rename, JoinDomainOrWorkgroup, UnjoinDomainOrWorkgroup - HELP Pin
Uros Calakovic6-Mar-09 21:06
Uros Calakovic6-Mar-09 21:06 

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.