コード例 #1
0
        public void runService(string wsdlKey, Dictionary <String, String> args)
        {
            switch (wsdlKey)
            {
            case "ChannelAdvisor.Admin":
                //AdminService admin = new AdminService ("ac93793a-4b71-44d4-ad4d-d302c39c238c","Domo123!");
                APICredentials creds = new APICredentials()
                {
                    DeveloperKey = "ac93793a-4b71-44d4-ad4d-d302c39c238c",
                    Password     = "******"
                };
                //AdminService admin = AdminService.getInstance ("ac93793a-4b71-44d4-ad4d-d302c39c238c", "Domo123!");
                AdminService admin = AdminService.getInstance(args.get("developerKey"), args.get("developerPassword"));
                admin.APICredentialsValue = creds;
                var result = admin.GetAuthorizationList(args.get("localId")).ResultData;

                foreach (AuthorizationResponse resp in result)
                {
                    Console.WriteLine(resp.AccountID + ":" + resp.LocalID);
                }
                break;

            case "CelsiusToFarenheit":
                TempConvert converter = new TempConvert();
                Console.WriteLine(converter.CelsiusToFahrenheit(args.get("temperature")));
                break;

            case "FarenheitToCelsius":
                TempConvert converter2 = new TempConvert();
                Console.WriteLine(converter2.FahrenheitToCelsius(args.get("temperature")));
                break;

            default: throw new Exception("MagicException:Domo encountered error running service:Unable to map SOAP wsdl");
            }
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: kurtrips/tc
        static void Main(string[] args)
        {
            TempConvert tc = new TempConvert();

            tc.UseDefaultCredentials = true;

            short res = tc.CelsiusToFahrenheit(48);
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: geekster129/Cookbook
        static void Main(string[] args)
        {
            DirectoryInfo flList = new DirectoryInfo("e:\\");

            FileInfo[] files = flList.GetFiles();
            Console.WriteLine(files[0].GetHashCode());

            Console.WriteLine();

            byte[] byteData = new byte[200];
            char[] charData = new char[200];
            try
            {
                FileStream afile = new FileStream("e:\\test\\try.txt", FileMode.Open);
                using (StreamReader sr = new StreamReader(afile)) {
                    string line = sr.ReadLine();

                    while (line != null)
                    {
                        //Console.WriteLine(line);
                        line = sr.ReadLine();
                    }
                }
            } catch (IOException e) {
                Console.WriteLine("An I/O Exception has been thrown:");
                Console.WriteLine(e.ToString());
                Console.ReadKey();
                return;
            } catch (UnauthorizedAccessException e)
            {
                Console.WriteLine("An I/O Unauthorized has been thrown:");
                Console.WriteLine(e.ToString());
                Console.ReadKey();
                return;
            }

            TempConvert ws         = new TempConvert();
            string      celcius    = ws.FahrenheitToCelsius("100");
            string      fahrenheit = ws.CelsiusToFahrenheit("40");

            Console.WriteLine($"100 deg F = {celcius.ToString()} deg C");
            Console.WriteLine($"40 deg C = {fahrenheit.ToString()} deg F");
            Console.ReadKey();
        }