引用: http://www.dotblogs.com.tw/jimmyyu/archive/2009/09/24/10758.aspx
在js 裡面用 window.external 來呼叫winform的function
其他參考
http://www.iteye.com/topic/243494
========================================================
简介:window.external.AddFavorite这个把网站添加到浏览者收藏夹的脚本大家应该常常看过,但你还知道window.external的另外一些用法呢?由于是一些关于系统文件操作的命令,因为安全设置有些脚本会出错误.
1.external.AddDesktopComponent 把网站作为用户的Active桌面
语法:external.AddDesktopComponent(地址,类型[image/website],左距离,顶距离,宽度,长度)
- function j_adc(){ //例子
- window.external.AddDesktopComponent("http://...","website",0,0,800,600);
- }
2.external.AddFavorite 把网站加入到用户的收藏夹
语法:external.AddFavorite(网址,标题);
- function j_af(){
- window.external.AddFavorite(location.href, document.title);
- }
3.external.NavigateAndFind 搜索指定网站中的某个字段
语法:external.NavigateAndFind(文件地址,关键字,_Target)
- function j_an(){
- window.external.NavigateAndFind("http://...",gosearch.value,"");
- }
4.external.ShowBrowserUI 调用语言选择窗口与收藏夹管理窗口
语法:external.ShowBrowserUI(类型[LanguageDialog/OrganizeFavorites], null)
- <input type="button" name="Button" value="语言设置" onclick="window.external.ShowBrowserUI('LanguageDialog', null)">
- <input type="button" name="Submit2" value="整理收藏夹" onclick="window.external.ShowBrowserUI('OrganizeFavorites', null)">
5.external.ImportExportFavorites 导入与导出用户收藏夹
语法:external.ImportExportFavorites(导入/true 导出/false, 文件路径)
- <input type="button" name="Button" value="导入收藏夹" onClick=window.external.ImportExportFavorites(true,"http://...");>
- <input type="button" name="Button3" value="导出收藏夹" onClick=window.external.ImportExportFavorites(false,"http://...");>
6.external.addChanne 加入到频道
语法:external.addChannel(网页路径)
7.下面是external对象所有方法列表
Method | Description |
---|---|
AddChannel | Obsolete. Presents a dialog box that enables the user to add the specified channel, or to change the channel URL, if it is already installed. |
AddDesktopComponent | Adds a Web site or image to the Microsoft Active Desktop. |
AddFavorite | Prompts the user with a dialog box to add the specified URL to theFavorites list. |
AddSearchProvider | Adds a search provider to the registry. |
AddService | User initiated action to add a service. |
AddToFavoritesBar | Adds a URL to the Favorites Bar. |
AutoCompleteSaveForm | Saves the specified form in the AutoComplete data store. |
AutoScan | No longer available as of Internet Explorer 7. Attempts to connect to a Web server by passing the specified query through completion templates. |
BrandImageUri | Not supported. Retrieves the Uniform Resource Identifier (URI) of an alternate product image. |
bubbleEvent | Propagates an event up its containment hierarchy. |
ContentDiscoveryReset | Resets the list of feeds, search providers, and Web Slices associated with the page. |
CustomizeClearType | Not supported. Sets a registry value to turn ClearType on or off. |
CustomizeSettings | Not supported. Saves the user settings from a "first run" page. |
DefaultSearchProvider | Not supported. Retrieves the name of the user's default search provider. |
DiagnoseConnection | Not supported. Attempts to diagnose problems with the network connection. |
ImportExportFavorites | Deprecated. Handles the import and export of Internet Explorer favorites. |
InPrivateFilteringEnabled | Detects whether the user has enabled InPrivate Filtering. |
IsSearchMigrated | Not supported. Determines whether autosearch settings were migrated from a previous version of Internet Explorer. |
IsSearchProviderInstalled | Determines if a search provider has been installed for the current user and whether it is set as default. |
IsServiceInstalled | Check if a service is already installed. |
IsSubscribed | Obsolete. Retrieves a value indicating whether the client subscribes to the given channel. |
NavigateAndFind | Navigates to the specified URL and selects the specified text. |
PhishingEnabled | Not supported. Determines whether Microsoft Phishing Filter is enabled. |
raiseEvent | Triggers an event, as specified. |
RunOnceHasShown | Not supported. Determines whether the "first run" page has been shown. |
RunOnceRequiredSettingsComplete | Not supported. Sets a registry value to indicate whether the "first run" page completed successfully. |
RunOnceShown | Not supported. Sets a registry value to indicate that the "first run" page has been shown. |
SearchGuideUrl | Not supported. Retrieves the URL of a page that can be used to install additional search providers. |
setContextMenu | Constructs a context menu, as specified. |
ShowBrowserUI | Opens the specified browser dialog box. |
SkipRunOnce | Not supported. Enables the user to select "first run" settings at a later time. |
SkipTabsWelcome | Not supported. Disables the welcome screen that appears when opening a new tab in Internet Explorer 7. |
SqmEnabled | Not supported. Determines whether Software Quality Monitoring (SQM) is enabled. |
参考:http://msdn.microsoft.com/en-us/library/ms535246%28VS.85%29.aspx
0 意見:
張貼留言