Esempio n. 1
0
        static void Main(string[] args)
        {
            try
            {
                string       ipAddress      = "";
                const string ServerRegistry = "SOFTWARE\\Goji Solutions\\Harmoni";
                clsRegistry  reg            = new clsRegistry();
                ipAddress = reg.GetStringValue(Registry.LocalMachine, ServerRegistry, "LocalIpAddress");
                if (ipAddress == null)
                {
                    Console.WriteLine("Failed to get the resgitry key for local ip address");
                }
                else
                {
                    WCFConnect.OpenService(ipAddress, 8022);
                }
            }
            catch (Exception err)
            {
                Console.WriteLine(err.Message);
                Console.ReadKey();
                return;
            }

            Console.ReadLine();
            WCFConnect.Close();
        }
Esempio n. 2
0
        private void OnCreated(object sender, FileSystemEventArgs e)
        {
            try
            {
                const string FMT  = "yyyy-MM-dd HH:mm:ss.fffffff";
                clsRegistry  reg  = new clsRegistry();
                string       time = reg.GetStringValue(
                    Registry.LocalMachine,
                    "SOFTWARE\\Goji solutions\\Field\\Watson\\",
                    "StartCapture");
                if (reg.strRegError != null)
                {
                    throw (new SystemException("Cannot get watson start time"));
                }
                m_startTime = DateTime.ParseExact(time, FMT, CultureInfo.InvariantCulture, DateTimeStyles.AssumeLocal);


                // first date time is the created time , second is the upload time
                ulong g360Index;
                //Console.WriteLine("e.FullPath:" + e.FullPath);
                //Console.WriteLine("m_startTime:" + m_startTime);
                //Console.WriteLine("m_FileOwnerUserName:"******"Add file Ok");
                pCallback(18, m_clientIpAddress, Path.GetFileName(e.FullPath), e.FullPath, "Watson file", 1, m_startTime, g360Index, m_FileOwnerUserName);
                //Console.WriteLine("Add file to queue: " + e.FullPath);
                m_event.Set();
            }
            catch (Exception err)
            {
                Console.WriteLine(err.Message);
            }
        }
Esempio n. 3
0
        public Form1()
        {
            InitializeComponent();
            Control.CheckForIllegalCrossThreadCalls = false;

            NetCard.NetCard n         = new NetCard.NetCard();
            string          ipAddress = n.getComputerIP();
            clsRegistry     reg       = new clsRegistry();

            if (ipAddress == "0.0.0.0")
            {
                string bip = reg.GetStringValue(Registry.LocalMachine, "SOFTWARE\\Goji solutions\\Field", "IpAddress");
                if (reg.strRegError == null)
                {
                }
                else
                {
                    GetManualIpAddress g = new GetManualIpAddress();
                    if (g.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                    {
                        ipAddress = g.IpAddress;
                        reg.SetStringValue(Registry.LocalMachine, "SOFTWARE\\Goji solutions\\Field", "IpAddress", ipAddress);
                    }
                }
            }
            label5.Visible = true;
            label5.Text    = ipAddress;
            label1.Text    = "Goji MPFM Watson WCF Field installation version " + Properties.Settings.Default.WatsonInstallerVersion;
            ThreadedExecuter <string> executer = new ThreadedExecuter <string>(ProcessThread_1, ThreadCompleted);

            executer.Start();
        }
Esempio n. 4
0
        void OpenService()
        {
            try
            {
                string       ipAddress             = "10.0.0.17";
                const string MegaPopServerRegistry = "SOFTWARE\\Eli\\ChatServer";
                clsRegistry  reg = new clsRegistry();
                ipAddress = reg.GetStringValue(Registry.LocalMachine, MegaPopServerRegistry, "LocalIpAddress");



                // Create the url that is needed to specify
                // where the service should be started
                urlService = "net.tcp://" + ipAddress + ":8099/ChatService";

                // Instruct the ServiceHost that the type
                // that is used is a ServiceLibrary.service1
                host          = new ServiceHost(typeof(ChatService));
                host.Opening += new EventHandler(host_Opening);
                host.Opened  += new EventHandler(host_Opened);
                host.Closing += new EventHandler(host_Closing);
                host.Closed  += new EventHandler(host_Closed);

                // The binding is where we can choose what
                // transport layer we want to use. HTTP, TCP ect.
                NetTcpBinding tcpBinding = new NetTcpBinding();
                tcpBinding.TransactionFlow = false;
                tcpBinding.Security.Transport.ProtectionLevel      = System.Net.Security.ProtectionLevel.EncryptAndSign;
                tcpBinding.Security.Transport.ClientCredentialType = TcpClientCredentialType.Windows;
                tcpBinding.Security.Mode = SecurityMode.Transport;
                // <- Very crucial

                // Add a endpoint
                host.AddServiceEndpoint(typeof(ChatServiceLib.IChatService), tcpBinding, urlService);

                // A channel to describe the service.
                // Used with the proxy scvutil.exe tool
                ServiceMetadataBehavior metadataBehavior;
                metadataBehavior =
                    host.Description.Behaviors.Find <ServiceMetadataBehavior>();

                if (metadataBehavior == null)
                {
                    // This is how I create the proxy object
                    // that is generated via the svcutil.exe tool
                    metadataBehavior                = new ServiceMetadataBehavior();
                    metadataBehavior.HttpGetUrl     = new Uri("http://" + ipAddress + ":8002/ChatService");
                    metadataBehavior.HttpGetEnabled = true;
                    metadataBehavior.ToString();
                    host.Description.Behaviors.Add(metadataBehavior);
                    urlMeta = metadataBehavior.HttpGetUrl.ToString();
                }
                host.Open();
            }
            catch (Exception err)
            {
                File.AppendAllText("c:\\chatwcf.txt", err.Message + Environment.NewLine);
            }
        }
Esempio n. 5
0
        private void btnResetear_Click(object sender, RoutedEventArgs e)
        {
            bool ruta = new clsRegistry().DeleteKey("RUTA");

            if (ruta)
            {
                MessageBox.Show("Se ha eliminado el registro correctamente. La aplicacion de cerrará para aplicar los cambios.", "Mensaje", MessageBoxButton.OK, MessageBoxImage.Asterisk);
                System.Windows.Application.Current.Shutdown();
            }
        }
Esempio n. 6
0
        private void button2_Click(object sender, EventArgs e)
        {
            bool ruta = new clsRegistry().DeleteKey("RUTA");

            if (ruta)
            {
                MessageBox.Show("Se ha eliminado el registro correctamente. La aplicacion de cerrará para aplicar los cambios");
                Application.Exit();
            }
        }
Esempio n. 7
0
        public string GetClientGuid()
        {
            clsRegistry reg = new clsRegistry();

            m_fieldGuid = reg.GetStringValue(Registry.LocalMachine, "SOFTWARE\\Goji solutions\\Field", "Guid");
            if (reg.strRegError != null)
            {
                m_fieldGuid = "error no guid";
            }
            return(m_fieldGuid);
        }
Esempio n. 8
0
        public frmSelect()
        {
            InitializeComponent();
            string existe = new clsRegistry().Read("RUTA");

            if (existe != null)
            {
                textBox1.Text = existe.ToString();
            }
            else
            {
                textBox1.Text = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
            }
        }
Esempio n. 9
0
        public FileServerWinClient()
        {
            clsRegistry reg  = new clsRegistry();
            string      time = reg.GetStringValue(
                Registry.LocalMachine,
                "SOFTWARE\\Goji solutions\\Field\\Watson\\",
                "StartCapture");

            if (reg.strRegError == null)
            {
                m_startTime = DateTime.ParseExact(time, FMT, CultureInfo.InvariantCulture, DateTimeStyles.AssumeLocal);
            }

            m_fieldGuid = reg.GetStringValue(Registry.LocalMachine, "SOFTWARE\\Goji solutions\\Field", "Guid");
            if (reg.strRegError != null)
            {
                m_fieldGuid = "error no guid";
            }

            uint x;

            x = reg.GetDWORDValue(Registry.LocalMachine, "SOFTWARE\\Goji solutions\\Field\\Streaming", "fifo_threshold");
            if (reg.strRegError == null)
            {
                if (x > 2)
                {
                    m_fifoFileThreshold = (int)x;
                }
            }

            // Get string value
            string strValue = reg.GetStringValue(
                Registry.LocalMachine,
                "SOFTWARE\\Goji solutions\\Field\\Watson",
                "WatsonStatus");

            if (reg.strRegError == null && strValue == "running")
            {
                m_watsonRunning = true;
            }
            if (reg.strRegError == null && strValue == "stopped")
            {
                m_watsonRunning = false;
            }
        }
Esempio n. 10
0
        public void SetCallback(CallbackMessage p)
        {
            pCallback = p;

            clsRegistry reg = new clsRegistry();
            uint        x;

            x = reg.GetDWORDValue(Registry.LocalMachine, "SOFTWARE\\Goji solutions\\Field\\Streaming\\DropBox", "InitializeDropBoxOnStart");
            if (reg.strRegError == null)
            {
                if (x == 1)
                {
                    if (m_runDropBoxThread == null || m_runDropBoxThread.IsAlive == false)
                    {
                        m_runDropBoxThread = new Thread(RunBoxInitialize);
                        m_runDropBoxThread.Start();
                    }
                }
            }
        }
Esempio n. 11
0
 public string SetFifoThreshold(int depth)
 {
     if (depth >= 2)
     {
         m_fifoFileThreshold = depth;
         clsRegistry reg = new clsRegistry();
         uint        x;
         reg.SetDWORDValue(Registry.LocalMachine, "SOFTWARE\\Goji solutions\\Field\\Streaming", "fifo_threshold", depth);
         if (reg.strRegError == null)
         {
             return("ok");
         }
         else
         {
             return(reg.strRegError);
         }
     }
     else
     {
         return("Size less than 2");
     }
 }
Esempio n. 12
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            string ruta = textBox1.Text;

            if (ruta.Trim() != "" && Directory.Exists(ruta))
            {
                string existe     = new clsRegistry().Read("RUTA");
                bool   registrado = false;
                if (existe == null)
                {
                    //noexiste
                    registrado = new clsRegistry().Write("RUTA", ruta);
                }
                else
                {
                    new clsRegistry().DeleteKey("RUTA");
                    registrado = new clsRegistry().Write("RUTA", ruta);
                }
                if (!registrado)
                {
                    MessageBox.Show("Ocurrio un error al guardar la ruta.", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    //MessageBox.Show("Ocurrio un error al guardar la ruta.");
                }
                else
                {
                    MessageBox.Show("La ruta fue almacenada con exito.", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    clsBaseConfiguracion configuracion = new clsBaseConfiguracion();
                    this.DialogResult = DialogResult.OK;
                    this.Close();
                }
            }
            else
            {
                MessageBox.Show("Seleccione una ruta valida.", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
        }
Esempio n. 13
0
 void App_Startup(object sender, StartupEventArgs e)
 {
     if (!isPermited())
     {
         clsBaseMensaje.cs_pxMsgEr("ERR20", "");
         isInitialized = false;
         System.Windows.Application.Current.Shutdown();
     }
     else
     {
         //Buscar la ruta de almacen de archivos de FEI.
         string ruta = new clsRegistry().Read("RUTA");
         if (ruta == null)
         {//En caso no exista mostrar el formulario de seleccion de ruta.
             frmSelect f = new frmSelect();
             if (f.ShowDialog() == DialogResult.OK)
             {
                 //Si ingresa la ruta mostrar el inicion de sesion.
                 //InicioSesion inicio = new InicioSesion();
                 //inicio.Show();
                 presentacion Presentacion_FEI = new presentacion();
                 Presentacion_FEI.Show();
             }
         }
         else
         {
             //Iniciar configuracion actual y mostrar inicio de sesion.
             clsBaseConfiguracion configuracion = new clsBaseConfiguracion();
             //Mostrar formulario de Inicio de Sesion.
             //InicioSesion inicio = new InicioSesion();
             //inicio.Show();
             presentacion Presentacion_FEI = new presentacion();
             Presentacion_FEI.Show();
         }
     }
 }
Esempio n. 14
0
        static void Main(string[] args)
        {
            /* if (PriorProcess() != null)
             * {
             *   clsBaseMensaje.cs_pxMsgEr("ERR20", "");
             *   return;
             * }*/
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            /* string Code = GetMD5("FEI-Contasis-2016");
             * if (args.Length > 0)
             * {
             *   if (args[0].ToString() == Code)
             *   {*/

            try
            {
                /* if (args.Length > 0)
                 * {
                 *   if (args[0].ToString() == "1")
                 *   {*/
                // Application.Run(new frmLogin());
                string ruta = new clsRegistry().Read("RUTA");
                if (ruta == null)
                {
                    frmSelect f = new frmSelect();

                    if (f.ShowDialog() == DialogResult.OK)
                    {
                        Application.Run(new frmLogin());
                    }
                }
                else
                {
                    clsBaseConfiguracion configuracion = new clsBaseConfiguracion();
                    Application.Run(new frmLogin());
                }

                /*  }
                 * else
                 * {
                 *    MessageBox.Show("Inicie desde FEI.exe");
                 * }
                 *
                 * }
                 * else
                 * {
                 * MessageBox.Show("Inicie desde FEI.exe");
                 * }*/
            }
            catch (Exception)
            {
                //throw;
            }

            /* }
             * else
             * {
             *   MessageBox.Show("Es necesario iniciar la aplicacion desde el lanzador de FEI");
             * }
             * }
             * else
             * {
             * MessageBox.Show("Es necesario iniciar la aplicacion desde el lanzador de FEI");
             * }*/
        }
Esempio n. 15
0
        void Initialize()
        {
            try
            {
                NetCard.NetCard n = new NetCard.NetCard();
                m_ipAddress = n.getComputerIP();
                while (m_ipAddress == "0.0.0.0")
                {
                    Thread.Sleep(10000);
                    m_ipAddress = n.getComputerIP();
                }
                File.WriteAllText("c:\\WCFStreamingClient.txt", "Initialized done: ip " + m_ipAddress);

                clsRegistry reg = new clsRegistry();
                m_fieldGuid = reg.GetStringValue(Registry.LocalMachine, "SOFTWARE\\Goji solutions\\Field", "Guid");
                if (reg.strRegError != null)
                {
                    m_fieldGuid = "error no guid";
                }

                FileServerWinClient.CallbackMessage pCallback = new FileServerWinClient.CallbackMessage(CallbackMessage);
                m_fileServerClient.SetCallback(pCallback);


                string strValue = reg.GetStringValue(
                    Registry.LocalMachine,
                    "SOFTWARE\\Goji solutions\\Field\\Watson",
                    "FileOwnerUserName");

                if (reg.strRegError == null)
                {
                    m_FileOwnerUserName = strValue;
                }
                else
                {
                    m_FileOwnerUserName = "******";
                }


                strValue = reg.GetStringValue(
                    Registry.LocalMachine,
                    "SOFTWARE\\Goji solutions\\Field\\Watson",
                    "WatsonStatus");
                if (reg.strRegError == null && strValue == "running")
                {
                    string userName;
                    userName = reg.GetStringValue(Registry.LocalMachine,
                                                  "SOFTWARE\\Goji solutions\\Field\\Watson",
                                                  "OperateUserName");

                    if (reg.strRegError != null)
                    {
                        pCallback(600, m_ipAddress, string.Empty, string.Empty, "Operator Owner does not exists", 0, DateTime.Now, 0, string.Empty);
                        return;
                    }

                    strValue = reg.GetStringValue(
                        Registry.LocalMachine,
                        "SOFTWARE\\Goji solutions\\Field\\Watson",
                        "StartWatchMonitorDirectory");
                    if (reg.strRegError == null)
                    {
                        if (Directory.Exists(strValue) == true)
                        {
                            m_fileServerClient.StartWatch(strValue, "*.bin", true, userName);
                        }
                    }
                }
            }
            catch (Exception err)
            {
                File.AppendAllText("c:\\GojiWCFStreamingClient.txt", err.Message);
            }
        }
Esempio n. 16
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            string rutaString = new clsRegistry().Read("RUTA");

            ruta.Content = rutaString;
        }
Esempio n. 17
0
        private void checkBox9_CheckedChanged(object sender, EventArgs e)
        {
            if (comboBox1.SelectedIndex == -1)
            {
                MessageBox.Show("please select upload type");
                return;
            }
            if (checkBox1.Checked == true)
            {
                if (comboBox1.SelectedIndex == 0)
                {
                    try
                    {
                        clsRegistry reg = new clsRegistry();
                        m_baseGuid = reg.GetStringValue(Registry.LocalMachine, "SOFTWARE\\Goji solutions\\Base", "Guid");
                        if (reg.strRegError != null)
                        {
                            m_baseGuid = Guid.NewGuid().ToString();
                            reg.SetStringValue(Registry.LocalMachine, "SOFTWARE\\Goji solutions\\Base", "Guid", m_baseGuid);
                        }

                        string guid = m_client.GetClientGuid();
                        m_client.StartTCPStreamingServer(1024 * 1024 * 10, 5005);

                        NetCard.NetCard n      = new NetCard.NetCard();
                        string          baseIp = n.getComputerIP();
                        if (baseIp == "0.0.0.0")
                        {
                            string bip = reg.GetStringValue(Registry.LocalMachine, "SOFTWARE\\Goji solutions\\Base", "IpAddress");
                            if (reg.strRegError == null)
                            {
                                baseIp = bip;
                            }
                            else
                            {
                                MessageBox.Show("You need to specify the base ip address in the registry");
                                return;
                            }
                        }
                        if (SetCopyTimerEvent() == false)
                        {
                            return;
                        }
                        m_client.OpenTCPStreamingClient(baseIp, textBox4.Text, textBox5.Text);
                        button14.Enabled = true;
                    }
                    catch (Exception err)
                    {
                        MessageBox.Show(err.Message);
                    }
                }
                else
                {
                }
                checkBox1.ForeColor = System.Drawing.Color.Green;
            }
            else
            {
                checkBox1.ForeColor = System.Drawing.Color.Red;
            }
        }
Esempio n. 18
0
        public Form1()
        {
            m_running = true;
            InitializeComponent();
            label18.Text = m_totalFieldFiles.ToString();
            Control.CheckForIllegalCrossThreadCalls = false;

            groupBox3.Enabled = false;
            p  = new GojiWCFStreamingBase.ClientCallbackMessage(ClientCallbackMsg);
            p1 = new GojiWCFStreamingBase.ServerCallbackMessage(ServerCallbackMsg);
            GojiWCFStreamingBase.SetServerCallback = p1;
            m_client = new GojiWCFStreamingBase(p);

            textBox1.Text = Properties.Settings.Default.FieldIpAddress;
            textBox7.Text = Properties.Settings.Default.FieldComputerUserName;
            textBox6.Text = Properties.Settings.Default.FieldComputerPassword;

            textBox4.Text           = Properties.Settings.Default.StorageServerUserName;
            textBox5.Text           = Properties.Settings.Default.StorageServerPassword;
            textBox2.Text           = Properties.Settings.Default.FieldDirectoryToMinotor;
            textBox3.Text           = Properties.Settings.Default.StorageDirectoryToUpload;
            comboBox1.SelectedIndex = Properties.Settings.Default.UploadMode;
            textBox10.Text          = Properties.Settings.Default.DeleteAllUploadedFilesTimer;
            textBox12.Text          = Properties.Settings.Default.uploadWrongFilesDirectory;
            textBox13.Text          = Properties.Settings.Default.SyncDirectory;
            checkBox4.Checked       = Properties.Settings.Default.RecoursiveSync;
            textBox14.Text          = Properties.Settings.Default.OperatorUserName;
            checkBox6.Checked       = Properties.Settings.Default.OperationsByUser;
            button14.Enabled        = false;

            try
            {
                MapNetworkDrives();
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message);
            }


            NetCard.NetCard n      = new NetCard.NetCard();
            string          baseIp = n.getComputerIP();

            if (baseIp == "0.0.0.0")
            {
                clsRegistry reg = new clsRegistry();
                string      bip = reg.GetStringValue(Registry.LocalMachine, "SOFTWARE\\Goji solutions\\Base", "IpAddress");
                if (reg.strRegError == null)
                {
                    baseIp    = bip;
                    this.Text = "Goji Field uploaded managment " + baseIp;
                }
                else
                {
                    MessageBox.Show("You need to specify the base ip address in the registry");
                    GetManualIpAddress g = new GetManualIpAddress();
                    g.ShowDialog();
                    if (g.DialogResult == System.Windows.Forms.DialogResult.OK)
                    {
                        baseIp    = g.IpAddress;
                        this.Text = "Goji Field uploaded managment " + baseIp;
                        reg.SetStringValue(Registry.LocalMachine, "SOFTWARE\\Goji solutions\\Base", "IpAddress", baseIp);
                    }
                    return;
                }
            }
            else
            {
                this.Text = "Goji Field uploaded managment " + baseIp;
            }
        }
Esempio n. 19
0
        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            if (comboBox1.SelectedIndex == -1)
            {
                MessageBox.Show("please select upload type");
                return;
            }

            clsRegistry reg = new clsRegistry();

            m_baseGuid = reg.GetStringValue(Registry.LocalMachine, "SOFTWARE\\Goji solutions\\Base", "Guid");
            if (reg.strRegError != null)
            {
                m_baseGuid = Guid.NewGuid().ToString();
                reg.SetStringValue(Registry.LocalMachine, "SOFTWARE\\Goji solutions\\Base", "Guid", m_baseGuid);
            }
            string guid = m_client.GetClientGuid();

            NetCard.NetCard n      = new NetCard.NetCard();
            string          baseIp = n.getComputerIP();

            if (baseIp == "0.0.0.0")
            {
                string bip = reg.GetStringValue(Registry.LocalMachine, "SOFTWARE\\Goji solutions\\Base", "IpAddress");
                if (reg.strRegError == null)
                {
                    baseIp = bip;
                }
                else
                {
                    MessageBox.Show("You need to specify the base ip address in the registry");
                    return;
                }
            }

            if (checkBox1.Checked == true)
            {
                if (comboBox1.SelectedIndex == 0)
                {
                    try
                    {
                        Dictionary <string, string> storageDirectoryDic = new Dictionary <string, string>();
                        storageDirectoryDic.Add(guid, textBox3.Text);
                        GojiWCFStreamingBase.StartStorageServer(storageDirectoryDic);


                        if (SetCopyTimerEvent() == false)
                        {
                            return;
                        }
                        m_client.AddDateToUploadTargetFolder(checkBox8.Checked);
                        m_client.ConnectToStreamingServer(baseIp, textBox4.Text, textBox5.Text);
                        button14.Enabled = true;
                    }
                    catch (Exception err)
                    {
                        MessageBox.Show(err.Message);
                    }
                }
                else if (comboBox1.SelectedIndex == 1)
                {
                    try
                    {
                        string s = m_client.InitializeDropBox();
                        if (s != "ok")
                        {
                            MessageBox.Show(s);
                        }
                        else
                        {
                            m_client.StartDropBoxUploadMode(true);
                            button14.Enabled = true;
                        }
                    }
                    catch (Exception err)
                    {
                        MessageBox.Show(err.Message);
                    }
                }
                else if (comboBox1.SelectedIndex == 2)
                {
                    m_client.StartTCPStreamingServer(1024 * 1024 * 30, 5005);
                    m_client.OpenTCPStreamingClient(baseIp, textBox4.Text, textBox5.Text);
                }
                checkBox1.ForeColor = System.Drawing.Color.Green;
            }
            else
            {
                if (comboBox1.SelectedIndex == 0)
                {
                    m_client.CloseCopyThread();
                    while (m_client.IsCopyThreadIsAlive() == true)
                    {
                        Application.DoEvents();
                        Thread.Sleep(1000);
                    }
                }
                else
                {
                    try
                    {
                        m_client.StartDropBoxUploadMode(false);
                    }
                    catch (Exception err)
                    {
                        MessageBox.Show(err.Message);
                    }
                }
                checkBox1.ForeColor = System.Drawing.Color.Red;
            }
        }
Esempio n. 20
0
        private void frmRutaArchivo_Load(object sender, EventArgs e)
        {
            string ruta = new clsRegistry().Read("RUTA");

            label2.Text = ruta;
        }