/code/ Настройка доверенной зоны в IE

Раздел посвящен программированию с использованием Power Basic.
jangle
Википедик
Википедик
Аватара пользователя
 
Сообщения: 3013
Зарегистрирован: 03.06.2005 (Пт) 12:02
Откуда: Нидерланды

/code/ Настройка доверенной зоны в IE

Сообщение jangle » 26.02.2012 (Вс) 20:28

Программная настройка доверенной зоны IE6-9, добавление в нее сайта интранет.

Код: Выделить всё
#Compile Exe
#Include "win32api.inc"

Function SetRegValue(lpKey As Long,ByVal cMainkey As String, ByVal Key As String, ByVal Setting As String) As Long
        On Error Resume Next
        Local hKey   As Long
        Local Result As Long
        Local zText  As AsciiZ * 2048
        If Key$ = "*" Then Key$ = Chr$(0,0)
        If RegCreateKeyEx(lpKey, cMainKey + Chr$(0),0, "", %REG_OPTION_NON_VOLATILE, _
                           %KEY_ALL_ACCESS, ByVal %NULL, hKey, Result) <> %ERROR_SUCCESS Then
            Function = 0
            Exit Function
        End If
        zText = Setting
        If Len(Setting) Then
            RegSetValueEx hKey, Key+Chr$(0), 0, %REG_SZ, zText, Len(Setting)+1
        Else
            RegSetValueEx hKey, Key+Chr$(0), 0, %REG_SZ, zText, 1
        End If
        RegCloseKey hKey
        Function = 0
End Function


Function SetRegValueDW (ByVal mKey As Long, lpSubKey As AsciiZ, lpValueName As AsciiZ, lpData As Dword) As Long
      Dim hKey As Long, dwDisposition As Long
      If RegCreateKeyEx(mKey, lpSubKey, ByVal 0&, "", %REG_OPTION_NON_VOLATILE, %KEY_ALL_ACCESS, _
         ByVal 0&, hKey, dwDisposition) = %ERROR_SUCCESS Then _
         Function = RegSetValueEx (hKey, lpValueName, ByVal 0&, %REG_DWORD, lpData, 4): _
         RegCloseKey hKey Else Function = 1
End Function


Function PBMain() As Long

Call SetRegValue(%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Ranges\Range1", ":Range", "10.10.40.151")
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Ranges\Range1", "http", 2)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "CurrentLevel", 0)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "MinLevel", 00010000)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "RecommendedLevel", 00010000)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "1001", 0)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "1004", 0)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "1200", 0)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "1201", 0)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "1206", 0)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "1207", 0)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "1400", 0)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "1402", 0)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "1406", 0)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "1407", 0)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "1601", 0)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "1604", 0)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "1605", 0)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "1606", 0)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "1607", 0)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "1608", 0)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "1609", 1)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "1800", 0)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "1802", 0)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "1804", 0)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "1805", 0)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "1806", 0)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "1807", 0)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "1808", 0)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "1809", 0)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "180D", 0)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "1A00", 0)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "1A02", 0)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "1A03", 0)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "1A04", 0)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "1A05", 0)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "1A06", 0)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "1A10", 0)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "1C00", 0)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "1E05", 0)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "2100", 0)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "2101", 1)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "2102", 0)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "2200", 0)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "2201", 0)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "2301", 0)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "2000", 0)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "2001", 0)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "2004", 0)
Call SetRegValueDW (%hkey_current_user, "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2", "2007",10000)
End Function

Вернуться в Power Basic

Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 1

    TopList