Hoping you can help me, I pretty new to c# & a bit stuck\confused on how to populate a textbox.
The background of this is I'm trying to use the XenAPI with a gui to list the virtual machines on my host Xen server, I have the code from the xenserver website but the example it shows is for a console , Here is the sample code from the XENAPI sample.
List<XenRef<Host>> hostRefs = Host.get_all(sessions);
foreach (XenRef<Host> hostRef in hostRefs)
//obtain the full host record from the server
Host host = host.get_record)session, hostRef);
//display name & desc
System.Console.WriteLine("Name: {0}", host.name_label);
System.Console.WriteLine("Hostname: {0}", host.name_hostname);
System.Console.WriteLine("Description: {0}", host.name_description);
System.Console.WriteLine("-");
}
Basically I'm trying to get the textbox/listbox in the gui to print the same information that the console code above does , Just a bit confused of how to do it , I understand you will have use the listbox & the foreach statement , after that is where I get confused , What do I put in place instead of the System.Console ??
Any help greatly appreciated
Cheers
Paul

New Topic/Question
Reply




MultiQuote







|