我怎么可以添加一个网址,以可信的站点?似乎有储存在登记册,但是究竟在哪里?
暗示我已经google搜索迄今为止没有帮助。

。净节目将运行在当地上的每一个客户。

编辑的澄清:我想要做到这一programmaticly运C#代码。

有帮助吗?

解决方案

以下应该给你的方式做到这一点在代码...

http://blogs.msdn.com/ie/archive/2005/01/26/361228.aspx

其他提示

它在于事实上在注册表中,这是正确的描述有:

http://msdn.microsoft.com/en-us/library/ms537181%28VS.85%29.aspx

当心UAC在Vista虽然。这是一个真正的痛苦来处理。

检查这个 解决方案 在CodeGuru论坛。

总之,这代码使用COM图书馆、图书馆,你有没有说你希望避免的。然而,没有解决这一情况。另一件事要说的是,这个代码是用C++编写的,为谁写的 CorithMartin,移植从C#。

#include "windows.h"
#include "stdafx.h"
#include "urlmon.h"
#using <mscorlib.dll>
#include <atldef.h>
#include <atlconv.h>
using namespace System;
using namespace System::Runtime::InteropServices;
#define MAX_LOADSTRING 100

int _tmain(int argc, _TCHAR* argv[])
{
    // constants from urlmon.h
    const int URLZONE_LOCAL_MACHINE = 0;
    const int URLZONE_INTRANET = URLZONE_LOCAL_MACHINE + 1;
    const int URLZONE_TRUSTED = URLZONE_INTRANET + 1;
    const int URLZONE_INTERNET = URLZONE_TRUSTED + 1;
    const int URLZONE_UNTRUSTED = URLZONE_INTERNET + 1;
    const int URLZONE_ESC_FLAG = 0x100;
    const int SZM_CREATE  = 0;
    const int SZM_DELETE  = 0x1;

    HRESULT hr;
    IInternetSecurityManager *pSecurityMgr;
    LPCWSTR sites = SysAllocString(L"http://*.mydomain.com");

    CoInitialize(NULL);

    hr = CoCreateInstance(CLSID_InternetSecurityManager, NULL, CLSCTX_INPROC_SERVER, IID_IInternetSecurityManager, (void**)&pSecurityMgr);

    pSecurityMgr->SetZoneMapping(URLZONE_TRUSTED, sites, SZM_CREATE);

    pSecurityMgr->Release();

    return 0;
}

Powershell

#Setting IExplorer settings
Write-Verbose "Now configuring IE"
#Add http://website.com as a trusted Site/Domain
#Navigate to the domains folder in the registry
set-location "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
set-location ZoneMap\Domains

#Create a new folder with the website name
new-item website/ -Force
set-location website/
new-itemproperty . -Name * -Value 2 -Type DWORD -Force
new-itemproperty . -Name http -Value 2 -Type DWORD -Force
new-itemproperty . -Name https -Value 2 -Type DWORD -Force

添加一个新的信任区域创建区注册键和文件夹的路径上 注册表\软件\微软\Windows\CurrentVersion\互联网设置\ZoneMap\域 每个域名创建一个新的 关键带的域名(sample.com) 一个新的关键根据这一与子(www) 并根据这一新的数与名称的方案(http或https) 值2在十六和,这是它,你得到它完成

这里有一个方法,简化过程。

  1. 创建一个.exe要求的领域(一个文本),指定 提供商(如选择框:所有,http,https,ftp)的点击"添加到网站 可信网站",然后做到以下几点:
  2. 创建一个临时文件夹在C:作为"C: empTS\"
  3. 创建一个.蝙蝠文件("C: empTS\AddTrustedSites.bat")与此类似:

设置regFile="C: empTS\AddTrustedSiteTS.reg"

回Windows注册编辑版本5.00>%regFile%

回声[注册表\软件\微软\Windows\CurrentVersion\互联网 设置\ZoneMap\域\MySecureDomain.com\www]>>%regFile

ECHO"https"=双字:00000002>>%regFile%

regedit/s%regFile%

DEL%regFile%

回声[注册表...ECHO"https"... 线可以重复的每个供应商进行检查。对于"所有"供应商,使用一个星号代替"https",像这样:

回声[注册表\软件\微软\Windows\CurrentVersion\互联网 设置\ZoneMap\域\MySecureDomain.com\www]>>%regFile% ECHO"*"=双字:00000002>>%regFile%

运行。蝙蝠文件使用这个呼吁:

系统。诊断。过程。开始("C: empTS\AddTrustedSites.bat")

之后。蝙蝠文件是跑(需要的仅仅是微秒),删除这两个蝙蝠文件和吸引目录。

MacSpudster

(a。k.a.GNoter,TechStuffBC)

=========================

信贷在信贷是由于:

regedit/s AddTrustedSite.reg

在"/s"将确认对话框剿

http://www.computerhope.com/registry.html

也:

看看 http://www.computing.net/answers/windows-xp/bat-file-to-add-trusted-site-in-ie/139995.html

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top