C# 클래스 Opc.Ua.Configuration.ConfigUtils

Utility functions used by COM applications.
파일 보기 프로젝트 열기: OPCFoundation/UA-.NET 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
CATID_OPCAEServer10 System.Guid
CATID_OPCDAServer20 System.Guid
CATID_OPCDAServer30 System.Guid
CATID_OPCHDAServer10 System.Guid
CATID_PseudoComServers System.Guid
CLSID_UaComAeProxyServer System.Guid
CLSID_UaComDaProxyServer System.Guid
CLSID_UaComHdaProxyServer System.Guid

공개 메소드들

메소드 설명
CLSIDFromProgID ( string progID ) : System.Guid

Returns the prog id from the clsid.

CheckFirewallAccess ( string executablePath, StringCollection baseAddresses ) : bool

Checks if the firewall has been configured.

CreateServer ( System.Guid clsid ) : object

Creates an instance of a COM server.

EnumClassesInCategory ( System.Guid category ) : List

Fetches the classes in the specified category.

GetAppIcon ( ) : System.Drawing.Icon

Gets the application icon.

GetComputerWorkgroupOrDomain ( ) : string

Returns the name of the workgroup or domain that the computer belongs to.

GetExecutablePath ( System.Guid clsid ) : string

Returns the location of the COM server executable.

GetFirewallAccess ( string executablePath ) : int[]

Returns the firewall access granted to an application.

GetImplementedCategories ( System.Guid clsid ) : List

Returns the implemented categories for the class.

GetLogFileDirectory ( ) : string

Gets the log file directory and ensures it is writeable.

GetNetFwAuthorizedApplication ( ) : NetFwTypeLib.INetFwAuthorizedApplication

Creates an instance of the NetFwAuthorizedApplication Class

GetNetFwMgr ( ) : NetFwTypeLib.INetFwMgr

Creates an instance of the NetFwMgr Class

GetNetFwOpenPort ( ) : NetFwTypeLib.INetFwOpenPort

Creates an instance of the NetFwOpenPort Class

InstallApplication ( InstalledApplication application, bool autostart, bool configureFirewall ) : void

Installs a UA application.

LocallyRegisterCertificateOIDs ( X509Certificate2 certificate ) : void

Registers the object ids required to access the certificate.

LocallyRegisterCertificateOIDs ( string OIDs ) : void

Registers the object ids required to access the certificate.

This function is used to work around a bug in .NET which results in long delays while OIDs are looked up in Active Directory. CryptFindOIDInfo is supposed to work like this: 1. A table of OID entries is constructed from registry entries with the CRYPT_INSTALL_OID_INFO_BEFORE_FLAG flag. This table is searched first. 2. An internal table of OID entries is then searched. Default OIDs that Microsoft knows about. 3. A table of OIDs constructed from the registry entries without the CRYPT_INSTALL_OID_INFO_BEFORE_FLAG flag is then searched. 4. Active Directory is searched. When registering the OID information with CryptRegisterOIDInfo(ptrInfo, 0) and hack the registry this is what will happen: 1. Any application that searches for an OID (with the OID flag) will find it at step 2. The OID will be correct as well as the friendly name since it uses CryptoAPI's internal table. 2. Any application that searches for a friendly name (with the friendly name flag) will find it as step 2. The OID info is good as stated above. 3. .NET code which searches for an OID (with the friendly name flag) will find the entry in step 3 because of our hack. 4. Any OIDs that isn't found at this point will be searched in the Active Directory. This code needs to be run once for each public key type.

ProcessCommandLine ( ) : bool

Checks if command line arguments specify configuration commands.

ProcessCommandLine ( string args ) : bool

Checks if arguments specify configuration commands.

ProgIDFromCLSID ( System.Guid clsid ) : string

Returns the prog id from the clsid.

RegisterClassInCategory ( System.Guid clsid, System.Guid catid ) : void

Registers the classes in the specified category.

RegisterClassInCategory ( System.Guid clsid, System.Guid catid, string description ) : void

Registers the classes in the specified category.

RegisterComTypes ( string filePath ) : List

Registers the COM types in the specified assembly.

ReleaseServer ( object server ) : void

Releases the server if it is a true COM server.

RemoveFirewallAccess ( ) : void

Removes the firewall access granted to the specified ports.

RemoveFirewallAccess ( Opc application, string executablePath ) : void

Configures the firewall to remove access to the specified application.

RemoveFirewallAccess ( string executablePath, IList baseAddresses ) : void

Configures the firewall to remove access to the specified application.

SetFirewallAccess ( Opc application, string executablePath ) : void

Configures the firewall to allow access to the specified application.

SetFirewallAccess ( string executablePath ) : void

Returns the firewall access granted to an application.

SetFirewallAccess ( string applicationName, string executablePath, IList baseAddresses ) : void

Configures the firewall to allow access to the specified application.

UninstallApplication ( InstalledApplication application ) : void

Uninstalls a UA application.

UnregisterClassInCategory ( System.Guid clsid, System.Guid catid ) : void

Unregisters the classes in the specified category.

UnregisterComServer ( System.Guid clsid ) : void

Removes the registration for a COM server from the registry.

UnregisterComTypes ( string filePath ) : List

Unregisters the COM types in the specified assembly.

UpdateConfigurationLocation ( string executablePath, string configurationPath ) : void

Updates the configuration location for the specified

비공개 메소드들

메소드 설명
CoCreateInstanceEx ( System.Guid &clsid, [ punkOuter, uint dwClsCtx, [ pServerInfo, uint dwCount, [ pResults ) : void
CreateCertificateForApplication ( InstalledApplication application ) : X509Certificate2

Creates a new certificate for application.

CryptFindOIDInfo ( Int32 dwKeyType, IntPtr pvKey, Int32 dwGroupId ) : IntPtr
CryptRegisterOIDInfo ( IntPtr pInfo, Int32 dwFlags ) : System.Boolean
FindFirstElement ( XmlElement parent, string localName, string namespaceUri ) : XmlElement

Finds the first child element with the specified name.

SetCertificatePermissions ( Opc application, CertificateIdentifier id, IList accessRules, bool replaceExisting ) : void

Updates the access permissions for the certificate store.

SetDefaults ( InstalledApplication application ) : void

Sets the defaults for all fields.

VerifyCodebase ( Assembly assembly, string filepath ) : void

Checks that the assembly loaded has the expected codebase.

메소드 상세

CLSIDFromProgID() 공개 정적인 메소드

Returns the prog id from the clsid.
public static CLSIDFromProgID ( string progID ) : System.Guid
progID string
리턴 System.Guid

CheckFirewallAccess() 공개 정적인 메소드

Checks if the firewall has been configured.
public static CheckFirewallAccess ( string executablePath, StringCollection baseAddresses ) : bool
executablePath string
baseAddresses StringCollection
리턴 bool

CreateServer() 공개 정적인 메소드

Creates an instance of a COM server.
public static CreateServer ( System.Guid clsid ) : object
clsid System.Guid
리턴 object

EnumClassesInCategory() 공개 정적인 메소드

Fetches the classes in the specified category.
public static EnumClassesInCategory ( System.Guid category ) : List
category System.Guid
리턴 List

GetAppIcon() 공개 정적인 메소드

Gets the application icon.
public static GetAppIcon ( ) : System.Drawing.Icon
리턴 System.Drawing.Icon

GetComputerWorkgroupOrDomain() 공개 정적인 메소드

Returns the name of the workgroup or domain that the computer belongs to.
public static GetComputerWorkgroupOrDomain ( ) : string
리턴 string

GetExecutablePath() 공개 정적인 메소드

Returns the location of the COM server executable.
public static GetExecutablePath ( System.Guid clsid ) : string
clsid System.Guid
리턴 string

GetFirewallAccess() 공개 정적인 메소드

Returns the firewall access granted to an application.
public static GetFirewallAccess ( string executablePath ) : int[]
executablePath string
리턴 int[]

GetImplementedCategories() 공개 정적인 메소드

Returns the implemented categories for the class.
public static GetImplementedCategories ( System.Guid clsid ) : List
clsid System.Guid
리턴 List

GetLogFileDirectory() 공개 정적인 메소드

Gets the log file directory and ensures it is writeable.
public static GetLogFileDirectory ( ) : string
리턴 string

GetNetFwAuthorizedApplication() 공개 정적인 메소드

Creates an instance of the NetFwAuthorizedApplication Class
public static GetNetFwAuthorizedApplication ( ) : NetFwTypeLib.INetFwAuthorizedApplication
리턴 NetFwTypeLib.INetFwAuthorizedApplication

GetNetFwMgr() 공개 정적인 메소드

Creates an instance of the NetFwMgr Class
public static GetNetFwMgr ( ) : NetFwTypeLib.INetFwMgr
리턴 NetFwTypeLib.INetFwMgr

GetNetFwOpenPort() 공개 정적인 메소드

Creates an instance of the NetFwOpenPort Class
public static GetNetFwOpenPort ( ) : NetFwTypeLib.INetFwOpenPort
리턴 NetFwTypeLib.INetFwOpenPort

InstallApplication() 공개 정적인 메소드

Installs a UA application.
public static InstallApplication ( InstalledApplication application, bool autostart, bool configureFirewall ) : void
application InstalledApplication
autostart bool
configureFirewall bool
리턴 void

LocallyRegisterCertificateOIDs() 공개 정적인 메소드

Registers the object ids required to access the certificate.
public static LocallyRegisterCertificateOIDs ( X509Certificate2 certificate ) : void
certificate System.Security.Cryptography.X509Certificates.X509Certificate2
리턴 void

LocallyRegisterCertificateOIDs() 공개 정적인 메소드

Registers the object ids required to access the certificate.
This function is used to work around a bug in .NET which results in long delays while OIDs are looked up in Active Directory. CryptFindOIDInfo is supposed to work like this: 1. A table of OID entries is constructed from registry entries with the CRYPT_INSTALL_OID_INFO_BEFORE_FLAG flag. This table is searched first. 2. An internal table of OID entries is then searched. Default OIDs that Microsoft knows about. 3. A table of OIDs constructed from the registry entries without the CRYPT_INSTALL_OID_INFO_BEFORE_FLAG flag is then searched. 4. Active Directory is searched. When registering the OID information with CryptRegisterOIDInfo(ptrInfo, 0) and hack the registry this is what will happen: 1. Any application that searches for an OID (with the OID flag) will find it at step 2. The OID will be correct as well as the friendly name since it uses CryptoAPI's internal table. 2. Any application that searches for a friendly name (with the friendly name flag) will find it as step 2. The OID info is good as stated above. 3. .NET code which searches for an OID (with the friendly name flag) will find the entry in step 3 because of our hack. 4. Any OIDs that isn't found at this point will be searched in the Active Directory. This code needs to be run once for each public key type.
public static LocallyRegisterCertificateOIDs ( string OIDs ) : void
OIDs string
리턴 void

ProcessCommandLine() 공개 정적인 메소드

Checks if command line arguments specify configuration commands.
public static ProcessCommandLine ( ) : bool
리턴 bool

ProcessCommandLine() 공개 정적인 메소드

Checks if arguments specify configuration commands.
public static ProcessCommandLine ( string args ) : bool
args string The arguments passed to the executable.
리턴 bool

ProgIDFromCLSID() 공개 정적인 메소드

Returns the prog id from the clsid.
public static ProgIDFromCLSID ( System.Guid clsid ) : string
clsid System.Guid
리턴 string

RegisterClassInCategory() 공개 정적인 메소드

Registers the classes in the specified category.
public static RegisterClassInCategory ( System.Guid clsid, System.Guid catid ) : void
clsid System.Guid
catid System.Guid
리턴 void

RegisterClassInCategory() 공개 정적인 메소드

Registers the classes in the specified category.
public static RegisterClassInCategory ( System.Guid clsid, System.Guid catid, string description ) : void
clsid System.Guid
catid System.Guid
description string
리턴 void

RegisterComTypes() 공개 정적인 메소드

Registers the COM types in the specified assembly.
public static RegisterComTypes ( string filePath ) : List
filePath string
리턴 List

ReleaseServer() 공개 정적인 메소드

Releases the server if it is a true COM server.
public static ReleaseServer ( object server ) : void
server object
리턴 void

RemoveFirewallAccess() 공개 정적인 메소드

Removes the firewall access granted to the specified ports.
public static RemoveFirewallAccess ( ) : void
리턴 void

RemoveFirewallAccess() 공개 정적인 메소드

Configures the firewall to remove access to the specified application.
public static RemoveFirewallAccess ( Opc application, string executablePath ) : void
application Opc
executablePath string
리턴 void

RemoveFirewallAccess() 공개 정적인 메소드

Configures the firewall to remove access to the specified application.
public static RemoveFirewallAccess ( string executablePath, IList baseAddresses ) : void
executablePath string
baseAddresses IList
리턴 void

SetFirewallAccess() 공개 정적인 메소드

Configures the firewall to allow access to the specified application.
public static SetFirewallAccess ( Opc application, string executablePath ) : void
application Opc
executablePath string
리턴 void

SetFirewallAccess() 공개 정적인 메소드

Returns the firewall access granted to an application.
public static SetFirewallAccess ( string executablePath ) : void
executablePath string
리턴 void

SetFirewallAccess() 공개 정적인 메소드

Configures the firewall to allow access to the specified application.
public static SetFirewallAccess ( string applicationName, string executablePath, IList baseAddresses ) : void
applicationName string
executablePath string
baseAddresses IList
리턴 void

UninstallApplication() 공개 정적인 메소드

Uninstalls a UA application.
public static UninstallApplication ( InstalledApplication application ) : void
application InstalledApplication
리턴 void

UnregisterClassInCategory() 공개 정적인 메소드

Unregisters the classes in the specified category.
public static UnregisterClassInCategory ( System.Guid clsid, System.Guid catid ) : void
clsid System.Guid
catid System.Guid
리턴 void

UnregisterComServer() 공개 정적인 메소드

Removes the registration for a COM server from the registry.
public static UnregisterComServer ( System.Guid clsid ) : void
clsid System.Guid
리턴 void

UnregisterComTypes() 공개 정적인 메소드

Unregisters the COM types in the specified assembly.
public static UnregisterComTypes ( string filePath ) : List
filePath string
리턴 List

UpdateConfigurationLocation() 공개 정적인 메소드

Updates the configuration location for the specified
public static UpdateConfigurationLocation ( string executablePath, string configurationPath ) : void
executablePath string
configurationPath string
리턴 void

프로퍼티 상세

CATID_OPCAEServer10 공개적으로 정적으로 프로퍼티

COM servers that support the AE 1.0 specification.
public static Guid,System CATID_OPCAEServer10
리턴 System.Guid

CATID_OPCDAServer20 공개적으로 정적으로 프로퍼티

COM servers that support the DA 2.0 specification.
public static Guid,System CATID_OPCDAServer20
리턴 System.Guid

CATID_OPCDAServer30 공개적으로 정적으로 프로퍼티

COM servers that support the DA 3.0 specification.
public static Guid,System CATID_OPCDAServer30
리턴 System.Guid

CATID_OPCHDAServer10 공개적으로 정적으로 프로퍼티

COM servers that support the HDA 1.0 specification.
public static Guid,System CATID_OPCHDAServer10
리턴 System.Guid

CATID_PseudoComServers 공개적으로 정적으로 프로퍼티

The category identifier for UA servers that are registered as COM servers on a machine.
public static Guid,System CATID_PseudoComServers
리턴 System.Guid

CLSID_UaComAeProxyServer 공개적으로 정적으로 프로퍼티

The CLSID for the UA COM AE server host process (note: will be eventually replaced the proxy server).
public static Guid,System CLSID_UaComAeProxyServer
리턴 System.Guid

CLSID_UaComDaProxyServer 공개적으로 정적으로 프로퍼티

The CLSID for the UA COM DA server host process (note: will be eventually replaced the proxy server).
public static Guid,System CLSID_UaComDaProxyServer
리턴 System.Guid

CLSID_UaComHdaProxyServer 공개적으로 정적으로 프로퍼티

The CLSID for the UA COM HDA server host process (note: will be eventually replaced the proxy server).
public static Guid,System CLSID_UaComHdaProxyServer
리턴 System.Guid