음. ActiveX를 안써도 되겠거니 했지만, 테스트 해보니 클라이언트쪽 레지스트리를 가져오는게 아니고

서버 쪽의 레지스트리 값을 가져오네요.. (뭐... 당연한거지만....)

 

출처 : http://support.microsoft.com/kb/316151/ko

 

Imports System.Diagnostics
Imports Microsoft.Win32

 

    Sub WriteRegistry(ByVal ParentKey As RegistryKey, ByVal SubKey As String, _
    ByVal ValueName As String, ByVal Value As Object)

        Dim Key As RegistryKey

        Try
            'Open the registry key.
            Key = ParentKey.OpenSubKey(SubKey, True)
            If Key Is Nothing Then 'if the key doesn't exist.
                Key = ParentKey.CreateSubKey(SubKey)
            End If

            'Set the value.
            Key.SetValue(ValueName, Value)

            Console.WriteLine("Value:{0} for {1} is successfully written.", Value, ValueName)
        Catch e As Exception
            Console.WriteLine("Error occurs in WriteRegistry" & e.Message)
        End Try
    End Sub

 

    Sub ReadRegistry(ByVal ParentKey As RegistryKey, ByVal SubKey As String, _
        ByVal ValueName As String, ByRef Value As String)

        Dim Key As RegistryKey

        Try
            'Open the registry key.
            Key = ParentKey.OpenSubKey(SubKey, True)
            If Key Is Nothing Then 'if the key doesn't exist
                Throw New Exception("The registry key doesn't exist")
            End If

            'Get the value.
            Value = Key.GetValue(ValueName)

            'Console.WriteLine("Value:{0} for {1} is successfully retrieved.", Value, ValueName)
        Catch e As Exception
            'Console.WriteLine("Error occurs in ReadRegistry" & e.Message)
        End Try
    End Sub

 

 

Sub Main()
    WriteRegistry(Registry.CurrentUser, "Software\MySoftware", "Count", 123)

    Dim Value As Object
    ReadRegistry(Registry.CurrentUser, "Software\MySoftware", "Count", Value)

    Console.ReadLine()
End Sub

 

설명은 생략...

해외에서는 IE점유율이 없어서...

즉, ActiveX를 싫어해서, Asp.net 을 이용해서 레지스트리 값을 얻어온뒤 게임을 실행하는 방법을 연구중...

 

이전에 구글링해서 얻은 자료는 2001년꺼라... 작동도 안되고 ㅠㅠ..

 

어쨋든... 이후 프로그램 실행은..

Dim gamePath As String
gamePath = ""
ReadRegistry(Registry.CurrentUser, "Software\OceanFishing", "Path", gamePath)
Shell(gamePath + " " + GameLauncherIncode(id, 12345678), AppWinStyle.NormalFocus)

 

이런식으로 실행시키면 ok.....

 

서버 점검하던중 뭔가 설정이 초기화 됬는지,

갑자기 서버 관리자 페이지에서 쿼리가 먹히지 않더군요.   (사용자 'x맨'이(가) 로그인 하지 못했습니다)

 

먼저 서비스 DB에 연결 되어있는건 확인됬고,

다음 게임 컨텐츠 DB에 연결 하려고, 안의 프로시저를 실행해본 결과, 특정 DB에만 접속을 못하고 아래의 에러가 나왔습니다.

"메시지 18456, 수준 14, 상태 1, 서버 <computer_name>, 줄 1"

"사용자 '<user_name>'이(가) 로그인하지 못했습니다."

"메시지 4064, 수준 16, 상태 1,"

사용자 기본 데이터베이스를 열 수 없습니다. 

 

 

결국, 이 얘긴 해당 DB에서 상대쪽 DB에 접근이 안된다는 의미이고,

msdn 의 http://support.microsoft.com/kb/307864/ko 의 도움말을 살펴본 결과

 

상대쪽 DB 보안 -> 로그인 -> 해당 계정의 기본 DB지정에 문제가 있음을 알게 되었습니다.

 

 

결국... 기본 DB를 연결해 주려는 DB로 설정하니 말끔이 해결...

 

... 알고나면 허망한 sql 세계 ㅠㅠ

+ Recent posts