如何使用VB从ASP.NET打开.chm文件 [英] How to open .chm file from ASP.NET using VB

查看:96
本文介绍了如何使用VB从ASP.NET打开.chm文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi
当点击F2或asp按钮点击具有特定主题或内容的活动时,如何从Asp.net打开帮助文件。



在Windows应用程序中获得HelpProvider F1控制并使用此代码可以打开帮助的特定主题或特定内容。



Hi How to open help file from Asp.net when click F2 or asp button click event with specific topic or content.

In windows application got HelpProvider F1 control and using this code can open specific topic or specific content of the help.

Dim hlpProvider As HelpProvider
hlpProvider = New System.Windows.Forms.HelpProvider()

' Help file
hlpProvider.HelpNamespace = "helpFile.chm"
hlpProvider.SetHelpNavigator(TextBox1, HelpNavigator.TableOfContents)





但是如何打开具有特定主题的.chm文件,无需从浏览器下载选项或以任何其他方式打开帮助文件以.chm文件以外的其他格式。



我尝试了什么:



我尝试以这种方式打开,但它下载如果打开,它总是打开第一个主题。这是我在客户端的代码。



document.onkeyup = KeyCheck;



函数KeyCheck(e){

var KeyID =(window.event)? event.keyCode:e.keyCode;

if(KeyID == 113){



window.open(help / Test.chm ,_ self);



}

}



和在服务器端我尝试使用此代码,没有任何反应



But how open .chm file with specific topic and without download option from browser or any other way to open help file which in different format, other than .chm file.

What I have tried:

I am try to open in this way,but it download and if open ,it open 1st topic always.This is my code in client side.

document.onkeyup = KeyCheck;

function KeyCheck(e) {
var KeyID = (window.event) ? event.keyCode : e.keyCode;
if (KeyID == 113) {

window.open("help/Test.chm", "_self");

}
}

And in server side i try with this code,nothing happen

Dim p As New Process()
p.StartInfo.FileName = "ms-its:file:///" + System.Web.HttpContext.Current.Server.MapPath("Test.chm") +
p.Start()

推荐答案

简单,你没有。



首先,所有ASP.NET代码完全在服务器上运行,不是客户。启动进程将仅在Web服务器上启动它。它不会在客户端计算机上启动。



接下来,您可能使用.CHM帮助文件的唯一方法是将其下载到客户端计算机。我从未见过任何网站上使用过的CHM文件。这可能是因为客户端计算机上的所有资源和文件都禁止在浏览器中运行的代码。



我不知道你打算为什么提供帮助,但CHM文件可能不是您在网站上最好的选择。
Simple, you don't.

First, ALL ASP.NET CODE RUNS ENTIRELY ON THE SERVER, not the client. Starting a Process will start it on the web server only. It will not start on the client machine.

Next, the only way you could possibly use a .CHM help file is if it was downloaded to the client machine. I've never seen a CHM file used on any website ever. This is probably because all resources and files on a client machine are off-limits to code running in a browser.

I have no idea what you intend to provide help for, but a CHM file is probably not going to be your best bet in a web site.


这篇关于如何使用VB从ASP.NET打开.chm文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆