Export (0) Print
Expand All

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
[C#]
public bool GetStronglyTypedClassCode(
 CodeLanguage lang,
 string filePath,
 string classNamespace
);
[C++]
public: bool GetStronglyTypedClassCode(
 CodeLanguage lang,
 String* filePath,
 String* classNamespace
);
[JScript]
public function GetStronglyTypedClassCode(
   lang : CodeLanguage,
 filePath : String,
 classNamespace : String
) : Boolean;

Parameters

lang
The language of the code to be generated.
filePath
The path of the file where the code is to be written.
classNamespace
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.

Example

[C#] 
using System;
using System.Management; 
   
ManagementClass cls = new ManagementClass(null,"Win32_LogicalDisk",null,"");
cls.GetStronglyTypedClassCode(CodeLanguage.CSharp,"C:\temp\Logicaldisk.cs",String.Empty);
   

[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.

Requirements

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

Show:
© 2014 Microsoft