-_- 그냥... 무지 간단하다..

다른거 필요없다;;

혹여나 모르시는 분들을 위해;;

필자도 오랜만에 해본 것이라서 잊을까봐;;

일단 허브에 해당 랜선을 다 꽂는다 -_- 물론 컴퓨터에도 꽂아야겠죠?

그 다음.. -_- DNS를 제외한 IP와 Subnetmask, Gateway를 입력하면.. 끝이다..

아 참고로 -_- 오라클이나 SQL같은 Datadase도 연결 가능하겠죠?^_^

네!! 가능합니다!!
[C#]네트워크 폴더 접근 C# 2008. 9. 18. 13:14
같은 네트워크 상에서의 네트워크 연결이 된 공유 폴더에 접근하기 위해서는

WNet을 이용해야한다.

result 변수 값이 0 이면 접근 허용

공유 폴더 경로 문제는 1203 오류 코드

사용자/암호가 일치 하지 않다면 1326 오류 코드가 발생한다.

명시적으로 로컬 드라이브를 지정하고 싶다면 NETRESOURCE 구조체의 lpLocalName 필드에 

드라이브 값을 설정이 가능하다.

이미 네트워크 드라이브 사용 중이라면 오류 코드 85

사용 가능한 로컬 드라이브 (Z, Y, X, W, 등의 순서) 이름의 선택을 시스템에게 맞기고 싶다면 flags 값에 0x80 을 주면 시스템이 적절한 로컬 드라이브 이름을 선택해 줄 것이다.

capacity 값은 공유 폴더의 경로를 담을 수 있도록 충분히 주어야 하지만
 
그렇지 않을 경우 오류 코드 234를 반환할 것이다.

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
        public struct NETRESOURCE
        {
            public uint dwScope;
            public uint dwType;
            public uint dwDisplayType;
            public uint dwUsage;
            public string lpLocalName;
            public string lpRemoteName;
            public string lpComment;
            public string lpProvider;
        }

        [DllImport("mpr.dll", CharSet = CharSet.Auto)]
        public static extern int WNetUseConnection(
         IntPtr hwndOwner,
         [MarshalAs(UnmanagedType.Struct)] ref NETRESOURCE lpNetResource,
         string lpPassword,
         string lpUserID,
         uint dwFlags,
         StringBuilder lpAccessName,
         ref int lpBufferSize,
         out uint lpResult);



public void setRemoteConnect(string strRemoteConnectString, string strRemoteUserID, string strRemotePWD)
        {
            int capacity = 64;
            uint resultFlags = 0;
            uint flags = 0;
            try
            {
                if ((strRemoteConnectString != "" || strRemoteConnectString != string.Empty) &&
                   (strRemoteUserID != "" || strRemoteUserID != string.Empty) &&
                   (strRemotePWD != "" || strRemotePWD != string.Empty))
                {
                    System.Text.StringBuilder sb = new System.Text.StringBuilder(capacity);
                    NETRESOURCE ns = new NETRESOURCE();
                    ns.dwType = 1;
                    ns.lpLocalName = null;
                    ns.lpRemoteName = @strRemoteConnectString;
                    ns.lpProvider = null;

                    int result = WNetUseConnection(IntPtr.Zero, ref ns, strRemotePWD, strRemoteUserID, flags, sb, ref capacity, out resultFlags);
                }
            }

   catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }