Exemplo n.º 1
0
        public static void Main(string[] args)
        {
            Print.output("my code...");
            string fname   = Print.input("enter filename");
            string content = Print.input("enter content");

            Filex.write(fname, content);
            Print.output(Filex.read(fname));

            // string[] lines = Filex.lines("readme.txt");
            // foreach(var line in lines){

            //  Print.output(line);
            // }
            // Filex.writeLines("thang.txt", lines);
        }
Exemplo n.º 2
0
        private void btnOnClickSend(object sender, RoutedEventArgs e)
        {
            List <Task> tasks = new List <Task>();

            ServiceReference2.DecryptClient platform = new ServiceReference2.DecryptClient();
            //Client.ServiceReference1.UserToken auth = platform.AuthUser(login, password, "d");
            foreach (string fileName in openFileDlgGlobal.FileNames)
            {
                bool   statusOp               = false;
                string operationVersion       = "1";
                string appVersion             = "toto";
                string operationName          = "m_service";
                string info                   = "Envoi du msg a .net";
                string tokenUser              = this.userToken.Tag.ToString();
                NameValueCollection appConfig = ConfigurationManager.AppSettings;
                string tokenApp               = appConfig.Get("AppToken");

                Filex    f    = new Filex(fileName);
                string   txt  = f.readFile();
                Object[] data = new Object[] {
                    f.FilePath,
                    txt
                };

                Task task = new Task(() =>
                {
                    Client.ServiceReference2.STG msg  = new STGClient(statusOp, operationVersion, appVersion, operationName, info, tokenUser, tokenApp, data);
                    Client.ServiceReference2.STG call = platform.m_service(msg);
                    System.Diagnostics.Debug.WriteLine("Return of the call = " + fileName + " - " + call.StatusOp.ToString());
                    //MessageBox.Show("Return of the call = " + fileName +" - "+ call.StatusOp.ToString());
                });

                tasks.Add(task);
                task.Start();
            }
            //Task.WaitAll(tasks.ToArray());
        }