Click here to Skip to main content
16,021,810 members
Home / Discussions / C#
   

C#

 
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 
GeneralRe: Win32_CompurterSystem: Rename, JoinDomainOrWorkgroup, UnjoinDomainOrWorkgroup - HELP Pin
mcldev10-Mar-09 10:46
mcldev10-Mar-09 10:46 
Questionproblems with my C# application Pin
laziale6-Mar-09 4:26
laziale6-Mar-09 4:26 
AnswerRe: problems with my C# application Pin
musefan6-Mar-09 4:31
musefan6-Mar-09 4:31 
GeneralRe: problems with my C# application Pin
laziale6-Mar-09 4:47
laziale6-Mar-09 4:47 
GeneralRe: problems with my C# application Pin
musefan6-Mar-09 4:55
musefan6-Mar-09 4:55 
GeneralRe: problems with my C# application Pin
laziale6-Mar-09 5:25
laziale6-Mar-09 5:25 
GeneralRe: problems with my C# application Pin
musefan6-Mar-09 5:30
musefan6-Mar-09 5:30 
GeneralRe: problems with my C# application Pin
laziale6-Mar-09 5:53
laziale6-Mar-09 5:53 
GeneralRe: problems with my C# application Pin
musefan6-Mar-09 6:00
musefan6-Mar-09 6:00 
GeneralRe: problems with my C# application Pin
Eddy Vluggen6-Mar-09 6:15
professionalEddy Vluggen6-Mar-09 6:15 
GeneralRe: problems with my C# application Pin
laziale6-Mar-09 6:44
laziale6-Mar-09 6:44 
GeneralRe: problems with my C# application Pin
Eddy Vluggen6-Mar-09 7:04
professionalEddy Vluggen6-Mar-09 7:04 
GeneralRe: problems with my C# application Pin
jaypatel5128-Mar-09 4:46
jaypatel5128-Mar-09 4:46 
QuestionCreating new object in another thread, then BeginInvoke that object? Pin
Matthew Klein6-Mar-09 4:13
Matthew Klein6-Mar-09 4:13 
AnswerRe: Creating new object in another thread, then BeginInvoke that object? Pin
Curtis Schlak.6-Mar-09 4:20
Curtis Schlak.6-Mar-09 4:20 
GeneralRe: Creating new object in another thread, then BeginInvoke that object? Pin
Matthew Klein6-Mar-09 5:55
Matthew Klein6-Mar-09 5:55 

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.