コード例 #1
0
ファイル: Program.cs プロジェクト: danofff/design_pattern2.0
        static void Main(string[] args)
        {
            IServer googleServer = new GoogleServer("https://www.google.com/username=admin&password=pass");

            googleServer.ProcessRequest();
            Console.ReadKey();
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: danofff/design_pattern2.0
            public void ProcessRequest()
            {
                if (googleServer == null)
                {
                    googleServer = new GoogleServer(Url);
                }

                string[] credentials = Url.Split(new string[] { "username="******"password="******"admin" && password == "password")
                {
                    Console.WriteLine("Connecting to " + Url);
                }
                else
                {
                    Console.WriteLine("connection trouble");
                }
            }