7

信頼済みサイトに URL を追加するにはどうすればよいですか? レジストリに保存されているようですが、正確にはどこですか?
これまでグーグルで調べたヒントは役に立ちませんでした。

.net プログラムは、各クライアントでローカルに実行されます。

編集の説明: C#コードをプログラムで実行したい。

4

7 に答える 7

4

MSDN

プログラムによるサイトの追加

C#

于 2010-03-18T15:30:56.633 に答える
3

以下は、コードでそれを行う方法を提供する必要があります...

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

于 2010-03-18T15:29:46.993 に答える
1

それは確かにレジストリにあり、そこに記述されています:

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

ただし、Vista では UAC に注意してください。対処するのは本当に苦痛です。

于 2010-03-18T15:31:06.620 に答える
1

Check this solution at CodeGuru forums.

In summary, this code uses the COM library, a library which you did say you wished to avoid. However, there is no workaround this situation. Another thing to mention is that this code is written in C++, as the guy who wrote it, CorithMartin, ported it from 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;
}
于 2010-03-18T15:27:09.597 に答える
1

パワーシェル

#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
于 2014-12-09T13:13:29.213 に答える
0

プロセスを簡素化する方法は次のとおりです。

  1. ドメイン(テキストボックス)を要求する.exeを作成し、プロバイダーを指定します(チェックボックスとして:すべて、http、https、ftp)[信頼済みサイトにサイトを追加]をクリックして、次の手順を実行します。
  2. C:に「C:\TempTS\」として一時フォルダを作成します
  3. 次のような.batファイル( "C:\ TempTS \ AddTrustedSites.bat")を作成します。

set regFile = "C:\ TempTS \ AddTrustedSiteTS.reg"

ECHO Windowsレジストリエディタバージョン5.00>%regFile%

ECHO [HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ ZoneMap \ Domains \ MySecureDomain.com \ www] >>%regFile

ECHO "https" = dword:00000002 >>%regFile%

regedit / s%regFile%

DEL%regFile%

ECHO[HKEY_CURRENT_USER...およびECHO"https"...行は、チェックされたプロバイダーごとに繰り返すことができます。「ALL」プロバイダーの場合、次のように「https」の代わりにアスタリスクを使用します。

ECHO [HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ ZoneMap \ Domains \ MySecureDomain.com \ www] >>%regFile%ECHO "*" = dword:00000002 >>%regFile%

次の呼び出しを使用して.batファイルを実行します。

System.Diagnostics.Process.Start( "C:\ TempTS \ AddTrustedSites.bat")

.batファイルが実行された後(わずかマイクロ秒かかります)、batファイルとtempTSディレクトリの両方を削除します。

MacSpudster

(別名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を参照してください

于 2011-09-06T20:40:49.177 に答える
0

新しいトラステッド ゾーンを追加するために、各ドメインのパス HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains にゾーン レジストリ キーとフォルダーが作成され、ドメイン名 (sample.com) を持つ新しいキーが作成されます。サブドメイン (www) を使用したこの下のキーと、この下のスキーム (http または https) の名前を持つ新しい REG_DWORD 16 進数の値 2 で、それで完了です。

于 2010-03-18T15:33:33.797 に答える