OBJECTIVE: To obtain a local system directory in the ASP page, provide a specified file to the ActiveX control path.
First, the ACTIVEX script referenced by the ASP page is as follows:
------------------------------------ Cxactive.aspX ----------- --------------------------------------------------
"Object style =" z-index: 101; left: 88px; width: 376px; position: absolute; top: 16px; height: 160px "codebase =" cxEos.cab "classid =" CLSID: C162A5cc-6bb1-4c0a-9081 -C520A4EADDA7 "Viewastext"
"Param name =" _ extentX "value =" 9948 ""
"Param name =" _ exTenty "value =" 4233 ""
"Param name =" Picture "value =" "% = path%" "// Here Path is a file path variable.
"/ Object"
Second, the ASP BEHINDCODE code is as follows:
---------------------------------------- Cxactive.aspx.cs ----- -----------------------------------------------
Public Class Webform1: System.Web.ui.page {public string path;
Private void page_load (object sender, system.eventargs e) {path = environment.systemDirectory.tostring (); // acquisition system directory path PATH = "// EOS // Picture // Abc.grf";}
}
Third, small knot
The above is just a method of environment, attached to other methods as follows: