简体   繁体   English

如何从下载的ActiveX控件中知道URI

[英]How to know URI from was downloaded ActiveX control

I have .NET(C#) ActiveX contol that was downloaded into IE from some URI, for example http://somehost/controlfolder/mycontrol.dll . 我有从某些URI(例如http://somehost/controlfolder/mycontrol.dll )下载到IE的.NET(C#)ActiveX控制。 That control have to download files from host via relative URI. 该控件必须通过相对URI从主机下载文件。 By URI 'files/file.ext' control have to download 'http://somehost/controlfolder/files/file.ext'. 通过URI,“ files / file.ext”控件必须下载“ http://somehost/controlfolder/files/file.ext”。

How my control can know main part of URI to construct from relarive URI full URI? 我的控件如何从相对的URI完整URI知道URI的主要部分?

UPD0: I'm using <object> tag for definition control in native html(without using ASP.NET). UPD0:我正在使用<object>标记进行本机html中的定义控制(不使用ASP.NET)。
UPD1: Is it possible to know server path without assigning public control property from Javascript? UPD1:是否可以在不从Javascript分配公共控件属性的情况下知道服务器路径?

Here are two ideas: 这里有两个想法:

  1. From javascript, set a property on your control to the root url. 在javascript中,将控件的属性设置为根URL。 myControl.RootUrl = window.location.replace ("default.aspx", ""); myControl.RootUrl = window.location.replace(“ default.aspx”,“”);
  2. From your aspx (or whatever engine you're using). 从您的aspx(或您使用的任何引擎)中获取。

    <object codebase='http://somehost/controlfolder/mycontrol.dll' ...> <param name="RootUrl" value="<% =Request.ApplicationPath + "/controlfolder/" %>"/> </object> <object codebase ='http://somehost/controlfolder/mycontrol.dll'...> <参数名称=“ RootUrl” value =“ <%= Request.ApplicationPath +” / controlfolder /“%>” /> </对象>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM