在Asp中可以用下面方法建立一个对象。   
Dim objChallenge  
Dim objHeader
Dim objKey 
Dim objRights 
Dim objLicense Set objChallenge = Server.CreateObject("wmrmobjs.wmrmchallenge")  
set objChallenge   =   nothing   
    
'Set the Header object
Set objHeader = Server.CreateObject("wmrmobjs.wmrmheader")'Generate the key from the Key object
Set objKey = server.CreateObject("wmrmobjs.wmrmkeys")'"""""""""""""""""""""""""""""""
'Rights object to generate rights
'"""""""""""""""""""""""""""""""
Set objRights = server.CreateObject("wmrmobjs.wmrmRights")'"""""""""""""""""""""""""""""""""
'Generate a license with the License object
'"""""""""""""""""""""""""""""""""
Set objLicense = Server.CreateObject("wmrmobjs.wmrmlicgen")
    我现在在asp.net的C#中要如何建立这个对象呢?   

解决方案 »

  1.   

     System.Type _ObjType = System.Type.GetTypeFromProgID("wmrmobjs.wmrmlicgen");
    object _ObjLicense =System.Activator.CreateInstance(_ObjType);看看行不
      

  2.   

    wmrmobjs.wmrmchallenge是一个什么东西?
    AxtiveX还是别的组件?
      

  3.   

    wmrmobjs是COM类型,我通过Visual2008把DLL引用进去了,能看到这些类型和方法,但是我不知道如何调用?是不是要先这样调用:using System.Runtime.InteropServices;WMRMChallenge Object
    The WMRMChallenge object is used to process a challenge from the client. A challenge is a request from the consumer for a license and contains the following information: Version 10 content header (backward compatible with version 7.1): 
    The key ID used to create a key. 
    A content ID to uniquely identify the encrypted content. 
    Attributes that identify the content. 
    A URL identifying the Internet address of the license issuer (the license acquisition URL). 
    The minimum application security version number required to play content. 
    Information about the consumer's computer: 
    An encrypted client ID. 
    The version of Windows Media Rights Manager on the consumer's computer. 
    The individualized version number on the consumer's computer. 
    Information about the secure audio path (SAP) kernel component. 
    InterfaceIRMGetLicense         Provides methods to store and predeliver a license. 
    IWMRMCoding           Converts between text and binary strings. 
    IWMRMHeaderSigning    Signs the ASF content header in memory.