示例#1
0
        private void Button1_Click(object sender, EventArgs e)
        {
            ServiceReference1.ServiceClient serviceClient = new ServiceReference1.ServiceClient();
            string lon = longitude.Text;
            string lat = latitude.Text;

            uvIndex.Text = serviceClient.solarIndex(lat, lon).ToString();
        }
        private void Go_button_Click(object sender, EventArgs e)
        {
            ServiceReference1.ServiceClient myClient = new ServiceReference1.ServiceClient();
            try { encrypted_label.Text = myClient.Encrypt(txtUrl.Text); }
            catch (Exception ec) { encrypted_label.Text = ec.Message.ToString(); }
            try { label_decrypted.Text = myClient.Decrypt(encrypted_label.Text); }
            catch (Exception dc) { label_decrypted.Text = dc.Message.ToString(); }

            ServiceReference2.ServiceClient myClient2 = new ServiceReference2.ServiceClient();
            try { label_stock.Text = myClient2.getStockquote(textBox_input_stock.Text); }
            catch (Exception ec_stock) { label_stock.Text = ec_stock.Message.ToString(); }

            webBrowser1.Navigate(txtUrl.Text);
        }
示例#3
0
        public void subirImagen(string filename)
        {
            using (ServiceReference1.ServiceClient client = new ServiceReference1.ServiceClient())
            {
                string   strFile  = System.IO.Path.GetFileName(filename);
                FileInfo fInfo    = new FileInfo(filename);
                long     numBytes = fInfo.Length;
                double   dLen     = Convert.ToDouble(fInfo.Length / 1000000);
                if (dLen < 4)
                {
                    FileStream fStream = new FileStream(filename,
                                                        FileMode.Open, FileAccess.Read);
                    BinaryReader br = new BinaryReader(fStream);

                    // convert the file to a byte array
                    byte[] data = br.ReadBytes((int)numBytes);
                    br.Close();
                    string gg = client.guardarImagen(data, strFile);
                    System.Diagnostics.Debug.WriteLine("Retorno: " + gg);
                }
            }
        }
示例#4
0
        public void DataSentToVM()
        {
            AlgorithmLibrary.ConfigData cd = new AlgorithmLibrary.ConfigData();


            List <double> taskruntimebyreffreq = new List <double>();
            List <double> processorfrequency   = new List <double>();
            List <double> coefficients         = new List <double>();

            foreach (KeyValuePair <double, double> entry in RuntimeByTaskID)
            {
                taskruntimebyreffreq.Add(entry.Value);
            }

            foreach (KeyValuePair <double, double> entry in FrequencyByProcessorID)
            {
                processorfrequency.Add(entry.Value);
            }

            foreach (KeyValuePair <double, double> entry in ValueByCoefficientID)
            {
                coefficients.Add(entry.Value);
            }

            RuntimeCalculations runtimeCalculations = new RuntimeCalculations(taskruntimebyreffreq, processorfrequency, ReferenceFrequency);

            runtimeCalculations.CalculateTaskRuntime();

            cd.ProcessorFrequency     = processorfrequency;
            cd.TaskRuntimeByFrequency = taskruntimebyreffreq;
            cd.TaskRuntimes           = runtimeCalculations.RuntimePerTasks;
            cd.MaxDuration            = ProgramMaxDurations;
            cd.Coefficients           = coefficients;
            cd.MaxProcessors          = ProgramProcessors;
            cd.MaxTasks     = ProgramTasks;
            cd.RefFrequency = ReferenceFrequency;

            ServiceReference1.ServiceClient localws = new ServiceReference1.ServiceClient();
            Alg2.ServiceClient localwsalg2          = new Alg2.ServiceClient();

            //was using a cloud architecture on AWS to solve aswell

            /*AlgVM1.ServiceClient ALGvmone = new AlgVM1.ServiceClient();
             * ALGAVM2.ServiceClient ALGvmtwo = new ALGAVM2.ServiceClient();
             * AlgAVM3.ServiceClient ALGavmthree = new AlgAVM3.ServiceClient();
             *
             * ALGBVM1.ServiceClient ALGbvmone = new ALGBVM1.ServiceClient();
             * ALGBVM2.ServiceClient ALGbvmtwo = new ALGBVM2.ServiceClient();
             * ALGBVM3.ServiceClient ALGbvmthree = new ALGBVM3.ServiceClient();*/

            List <double[]> catchList = new List <double[]>();

            if (FileName == "https://sit323sa.blob.core.windows.net/at2/TestA.txt")
            {
                FinalAnswer += "LOCAL WEBSERVICE" + "\r\n" + localwsalg2.AlgorithmTwo(cd);

                FinalAnswer += "\r\n" + localws.AlgorithmOne(cd) + "\r\n";

                //FinalAnswer += "AWS WEBSERVICE" + "\r\n" + ALGvmone.AlgorithmOne(cd);
                //FinalAnswer += "AWS WEBSERVICE" + "\r\n" + ALGvmtwo.AlgorithmOne(cd);
                //FinalAnswer += "AWS WEBSERVICE" + "\r\n" + ALGavmthree.AlgorithmOne(cd);

                //FinalAnswer += "AWS WEBSERVICE" + "\r\n" + ALGbvmone.AlgorithmTwo(cd);
                //FinalAnswer += "AWS WEBSERVICE" + "\r\n" + ALGbvmtwo.AlgorithmTwo(cd);
                //FinalAnswer += "AWS WEBSERVICE" + "\r\n" + ALGbvmthree.AlgorithmTwo(cd);
            }
            else
            {
                FinalAnswer += localwsalg2.AlgorithmTwo(cd) + "\r\n";

                //FinalAnswer += "AWS WEBSERVICE" + "\r\n" + ALGbvmone.AlgorithmTwo(cd);
                //FinalAnswer += "AWS WEBSERVICE" + "\r\n" + ALGbvmtwo.AlgorithmTwo(cd);
                //FinalAnswer += "AWS WEBSERVICE" + "\r\n" + ALGbvmthree.AlgorithmTwo(cd);
            }
        }