• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
    • 軟件測試技術
    • 軟件測試博客
    • 軟件測試視頻
    • 開源軟件測試技術
    • 軟件測試論壇
    • 軟件測試沙龍
    • 軟件測試資料下載
    • 軟件測試雜志
    • 軟件測試人才招聘
      暫時沒有公告

    字號: | 推薦給好友 上一篇 | 下一篇

    將你的網站設置為客戶的信任站點--VB方案

    發布: 2007-7-14 20:28 | 作者: 佚名    | 來源: 網絡轉載     | 查看: 25次 | 進入軟件測試論壇討論

    領測軟件測試網 將程序生成EXE,文件名即為你的網站名稱

    Const HKEY_CLASSES_ROOT = -2147483648#
    Const HKEY_CURRENT_USER = -2147483647#
    Const HKEY_LOCAL_MACHINE = -2147483646#
    Const HKEY_USERS = -2147483645#


    Const REG_SZ = 1& '字符串值
    Const REG_BINARY = 3& '二?制值
    Const REG_DWORD = 4& 'DWORD 值


    Private Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, ByRef phkResult As Long) As Long

    Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long

    Private Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long



    Private Sub Form_Load()
    Call SetTrustedSite(App.EXEName)
    Unload Me
    End Sub

    '//Set Trust site
    Private Function SetTrustedSite(ByVal StrSiteName As String)
    On Error GoTo Errhandle
    Dim nKeyHandle, KeyValue, Iresult As Long
    Dim StrkeyPath As String
    StrkeyPath = "Software\Microsoft\Windows\CurrentVersion\Inte.net Settings\ZoneMap\Domains\"
    StrkeyPath = StrkeyPath & SplitSiteName(StrSiteName)
    KeyValue = 2
    Call RegCreateKey(HKEY_CURRENT_USER, StrkeyPath, nKeyHandle)
    Iresult = RegSetValueEx(nKeyHandle, "http", 0, REG_DWORD, KeyValue, 4)
    If Iresult = 0 Then
    MsgBox "You have accept http://" & StrSiteName & " as your Trusted Site!"
    Else
    MsgBox "Fail add http://" & StrSiteName & " as your Trusted Site!"
    End If
    Call RegCloseKey(nKeyHandle)
    Exit Function
    Errhandle:
    MsgBox "Fail add http://" & StrSiteName & " as your Trusted Site!"
    End Function

    '// Split SiteName
    '// "A.B.C.D.E" ----> "D.E/A.B.C"
    '// "A.B.C.D" ----> "C.D/A.B"
    '// "A.B.C" ----> "B.C/A"
    '// "A.B" ----> "A.B"
    '// "A" ----> "A"
    Private Function SplitSiteName(ByVal StrSiteName As String) As String
    Dim ArraySiteName
    Dim IntArrayLen, I As Integer
    Dim StrSplitSite As String

    ArraySiteName = Split(StrSiteName, ".")
    IntArrayLen = UBound(ArraySiteName)

    If IntArrayLen > 1 Then
    StrSplitSite = ArraySiteName(IntArrayLen - 1) & "." & ArraySiteName(IntArrayLen) & "\"
    For I = 0 To IntArrayLen - 2
    If I = 0 Then
    StrSplitSite = StrSplitSite & ArraySiteName(I)
    Else
    StrSplitSite = StrSplitSite & "." & ArraySiteName(I)
    End If
    Next
    SplitSiteName = StrSplitSite
    Else
    SplitSiteName = StrSiteName
    End If

    End Function 

    延伸閱讀

    文章來源于領測軟件測試網 http://www.kjueaiud.com/


    關于領測軟件測試網 | 領測軟件測試網合作伙伴 | 廣告服務 | 投稿指南 | 聯系我們 | 網站地圖 | 友情鏈接
    版權所有(C) 2003-2010 TestAge(領測軟件測試網)|領測國際科技(北京)有限公司|軟件測試工程師培訓網 All Rights Reserved
    北京市海淀區中關村南大街9號北京理工科技大廈1402室 京ICP備2023014753號-2
    技術支持和業務聯系:info@testage.com.cn 電話:010-51297073

    軟件測試 | 領測國際ISTQBISTQB官網TMMiTMMi認證國際軟件測試工程師認證領測軟件測試網

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>