Setting Up the Global.asa File

banner art

Previous Next

Setting Up the Global.asa File

The sample pages are located in C:\WMSDK\WMRM10.1\Samples. Copy the sample files to the Web site root directory (for example, C:\Inetpub\Wwwroot\WM).

Modifying the Global.asa File

Open the Global.asa file in C:\WMSDK\WMRM10.1\Samples. If you have an existing Global.asa file, copy and paste the following code into it between Sub Application_OnStart and End Sub:

Application("siteurl") = "xxx"               ' URL for your license server
Application("KeyID") =  "xxx"                ' Key ID for pre-delivery

'Content Server information. In this sample, we support only one content server.        
Application("seed") = "xxx"                  ' License key seed
Application("contentserverpubkey") = "xxx"   ' Public key          
Application("contentserverprivkey") = "xxx"  ' Private key
Application("ownerid")  = "Company X"        ' Company name

You must fill in certain variables, such as your Web site URL, the key ID to use for testing the predelivery process, and your license key seed . You can generate the values for seed, contentserverpubkey, and contentserverprivkey by creating a script file as follows (three files are created, one file contains the license key seed, one contains the public key , and the other contains the private key ):

Dim WSHShell
Set WSHShell = WScript.CreateObject("WScript.Shell")

dim keysobjs
dim privkey
dim pubkey
dim seed

Set keysobj= CreateObject("wmrmobjs.WMRMKeys")
keysobj.GenerateSigningKeys privkey, pubkey
seed = keysobj.GenerateSeed()
Dim cmd
'Write the private key to privkey.txt
cmd = "cmd.exe /C echo " + privkey + " > privkey.txt"
WSHShell.Run cmd,0
'Write the public key to pubkey.txt
cmd = "cmd.exe /C echo " + pubkey + " > pubkey.txt"
WSHShell.Run cmd,0
'Write the license key seed to seed.txt
cmd = "cmd.exe /C echo " + seed + " > seed.txt"
WSHShell.Run cmd,0

After you have edited your Global.asa file, you must stop and restart the World Wide Web Service (at the command prompt, enter Net stop w3svc, then enter Net start w3svc).

Setting Up a New Global.asa File for Testing Sample Pages

If you do not have a Global.asa file, create a new directory and place the sample Global.asa file in it (for example, in C:\Inetpub\Wwwroot\Wm).

To enable a directory for a new global.asa file

  1. Create a host directory for the samples (for example, C:\Inetpub\Wwwroot\Wm).
  2. On the Start menu, point to Programs, point to Administrative Tools, and then click Internet Services Manager.
  3. Expand the icon for your server, and then click Default Web Site.
  4. In the content pane, right-click the host directory (for example, Wm) and click Properties.
  5. On the Directory tab under Application Settings, click Create.
  6. In Execute Permissions, click Scripts and Executables.
  7. Click OK.
  8. Stop and restart the World Wide Web Service (at the command prompt, enter Net stop w3svc, then enter Net start w3svc).

See Also

Previous Next

© 2007 Microsoft Corporation. All rights reserved.