http://www.codeproject.com/KB/system/osversion_producttype.aspx I just found this article after searching for ages... doesn't contain any other information for vista though...
Mike Bentzen
Posts
-
How to find Versioning Information -
How to find Versioning InformationThat shows you the version numbers but i cannot find how to locate or determine whether it is home or professional for xp or any of the different versions for vista. That class doesn't contain any other specifics.
-
How to find Versioning InformationHello, How is it possible to determine which operating system is in use on the computer? XP Home or Professional or Vista Basic/Home Premium/Business etc. Similarly, how is it possible to determine which version of office is installed Home and Student, Professional, Ultimate etc.. Thanks
-
checking an object is compatible with another objectThank you so much for your help, it is greatly appreciated. :)
-
checking an object is compatible with another objectwow, I didn't know how that worked. Now I'll have to go and do some more indepth reading on Generics. Just another question on comparing types. How do enums fit into the picture? Is enum a type? Can I compare a string to an enum (using the method above (using is keyword)), or one of the values in the enumto see if it can be converted?
-
checking an object is compatible with another objectChristian Graus wrote:
return (myvar is T);
where T is my parameter of type? bool CheckConfigVariable(object variable, Type expectedType) { return (variable is expectedType); } i get the error: The type or namespace name 'expectedType' could not be found (are you missing a using directive or an assembly reference?) (CS0246)
-
checking an object is compatible with another objectThis isn't exactly doing what i thought it was doing sorry. variable.GetType() == expectedType is checking whether Object is equal to Type blah. Its always returning false. I just want it to return if it is compatible with casting it to another object, not if it is the same type.
-
checking an object is compatible with another objecti am trying to write a method that checks whether an object can be cast to a specific type: that is, something like this:
bool CheckConfigVariable(object variable, Type expectedType) {
if (variable is expectedType) {
return true;
}
return false;
}but that doesn't seem to work. I've also tried:
object hello;
hello = (object)variable;
if (typeof(hello) == Type.GetTypeCode(typething)) {
return true;
}
return false;
}which sort of works, but it can't find the hello variable in the typeof function. How would I go about checking whether the object is a certain type from what is provided in the parameters of the called method? Mike
-
OpenSSL key generation in PEM formatHello, I am currently writing an application that needs to be able to generate a private and public key, but it must be output in PEM format. It needs this format because other related applications require this format. I can't find any functions in any libraries that do this. What would be the best way to do this? If there is nothing that does this, is there a way I could write another program in (for example: C) that generates the keys given command line options and just hope it succeeds? Kind Regards, Mike
-
class layoutHello, I am trying to write an application that will be able to manage an attendance list. It will talk back to a database and any updates made to the attendance list, will update the database. So basically, there are students and classes. each class has students. I want to be able to maintain a list of students and a list of classes. How should I go about doing this? I am thinking of having the classes: student - defines a student object class - defines a class object - list studentList - contains a list of ALL students - list classList - contains a list of ALL classes - list I would like to retrieve the student list of a particular class where should the method for this go? Should it go in classList? maybe getStudents(int classID) or class? just getstudents()? i want to also be able to add students to a particular class from studentList. where should the addStudentToClass method go? in the class or in the classList? If it belongs in class, how do you get access to the studentList? do I have to pass the studentList as a variable through the constructor when i create the class? I know I can do it by making the studentList a static class then i can access the method by students.Add(studentList.GetStudentByID(int studentID))? I would appreciate it greatly if someone could explain the levels of access and what classes should be able to access what by using the scenario above. Thank you, Kind Regards, Mike
-
.NET Sockets Problem [modified]Hello Everyone. I am currently having a lot of trouble with .NET sockets. I am trying to create a client with a windows forms interface. I have attempted to create a communication class which basically contains some functions for connecting and managing the connection.
public class connection { private TCPClient _client = new TCPClient(); public bool Connect(string hostname, int port) { try { _client.Connect(hostname, port); return true; } catch { return false; } } public bool IsConnected() { try { if (_client.Connected) { return true; } else { return false; } } catch { return false; } } }
Is a really basic connection class. I have multiple forms which I would like them to be able to control the connection and receive and display information on them. I understand that the usual way for all form instances to access the same things, is to declare those things as static. I have tried to make this class a static class but the TCPClient throws an error telling me that you can't have a static instance. I don't want multiple instances of this class. The client only needs to handle one connection at a time. I have gone through all C# tutorials and articles on code project, and they are really helpful if you are only using one form (with delegates) and custom event handlers. I want to be able to receive information from the socket, deserialize the data and use that data to populate classes, and form controls (for example: list box - of connected clients.) I would really appreciate it if you could explain why I can't have a static instance and maybe possibly links to tutorials or code samples of something similar to what I am describing above so I can try to understand how it works. Kindest Regards, Mikemodified on Friday, April 25, 2008 11:20 PM