This documentation is archived and is not being maintained.

ManagementClass.GetStronglyTypedClassCode Method (CodeLanguage, String, String)

.NET Framework 1.1

Generates a strongly-typed class for a given WMI class. This function generates code for Visual Basic, C#, or JScript, depending on the input parameters.

[Visual Basic]
Overloads Public Function GetStronglyTypedClassCode( _
   ByVal lang As CodeLanguage, _
   ByVal filePath As String, _
   ByVal classNamespace As String _
) As Boolean
public bool GetStronglyTypedClassCode(
 CodeLanguage lang,
 string filePath,
 string classNamespace
public: bool GetStronglyTypedClassCode(
 CodeLanguage lang,
 String* filePath,
 String* classNamespace
public function GetStronglyTypedClassCode(
   lang : CodeLanguage,
 filePath : String,
 classNamespace : String
) : Boolean;


The language of the code to be generated.
The path of the file where the code is to be written.
The .NET namespace into which the class should be generated. If this is empty, the namespace will be generated from the WMI namespace.

Return Value

true, if the method succeeded; otherwise, false.


using System;
using System.Management; 
ManagementClass cls = new ManagementClass(null,"Win32_LogicalDisk",null,"");

[Visual Basic, C++, JScript] No example is available for Visual Basic, C++, or JScript. To view a C# example, click the Language Filter button Language Filter in the upper-left corner of the page.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

ManagementClass Class | ManagementClass Members | System.Management Namespace | ManagementClass.GetStronglyTypedClassCode Overload List