Beispiel #1
0
        private void buttonX1_Click(object sender, EventArgs e)
        {
            OFD1.ShowDialog();
            Package STFS = new Package(OFD1.FileName);

            textBoxX1.Text = STFS.ProfileID;
            textBoxX2.Text = STFS.DeviceID;
            textBoxX3.Text = STFS.ConsoleID;
        }
Beispiel #2
0
        private void PictBox1_Click(object sender, EventArgs e)
        {
            OFD1.Filter = "Image Files(*.BMP;*.JPG;*.GIF;*.PNG)|*.BMP;*.JPG;*.GIF;";

            if (OFD1.ShowDialog() == DialogResult.OK)
            {
                PictBox1.Image = new Bitmap(OFD1.FileName);
            }
            else return;
        }
Beispiel #3
0
 private void buttonItem1_Click(object sender, EventArgs e)
 {
     try
     {
         OFD1.ShowDialog();
         PackageIO.Reader reader = new PackageIO.Reader(OFD1.FileName, Endian.Big, 0);
         reader.Position = 0x19A90;
         textBoxX1.Text  = reader.ReadInt32().ToString();
         reader.Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Beispiel #4
0
 private void buttonItem1_Click(object sender, EventArgs e)
 {
     try                                                                               //tries to do the following noted with //
     {
         OFD1.ShowDialog();                                                            //Opens the file dialog
         PackageIO.Reader reader = new PackageIO.Reader(OFD1.FileName, Endian.Big, 0); //Opens the Offset reader
         reader.Position = 0x12FB0;                                                    //Starts reading the offset at 19A90
         textBoxX1.Text  = reader.ReadInt32().ToString();                              //Prints the current offset to an Int32 integer
         reader.Close();                                                               //closes the reader so you can recall it or don't get file in use error
     }
     catch (Exception ex)                                                              //logs the error
     {
         MessageBox.Show(ex.Message);                                                  //shows the error message if something happens while opening
     }
 }
        private void btnEnviarficheiro_Click(object sender, EventArgs e)
        {
            OFD1.ShowDialog();
            string filename = OFD1.FileName;
            string readfile = File.ReadAllText(filename);

            string msg = filename;

            tbEnviarmensagem.Clear();
            byte[] packet = protocolSI.Make(ProtocolSICmdType.DATA, msg);
            networkStream.Write(packet, 0, packet.Length);
            while (protocolSI.GetCmdType() != ProtocolSICmdType.ACK)
            {
                networkStream.Read(protocolSI.Buffer, 0, protocolSI.Buffer.Length);
            }
        }
Beispiel #6
0
        private void EVEOpenFile(object sender, EventArgs e)
        {
            string rez = _currentpath;

            if (DialogResult.OK == OFD1.ShowDialog())
            {
                rez = OFD1.FileName;
                RTBMyText.LoadFile(OFD1.FileName);
            }

            else
            {
                MessageBox.Show("Cancel");
            }

            _currentpath = rez;
        }
Beispiel #7
0
 private void BtnImagen_Click(object sender, EventArgs e)
 {
     OFD1.InitialDirectory = "c:\\";
     OFD1.Filter           = "JPG|*.jpg;*.jpeg|PNG|*.png|GIF|*.gif";
     if (OFD1.ShowDialog() == DialogResult.OK)
     {
         try
         {
             // MessageBox.Show("Ruta Guardada: " + OFD1.FileName);
             //PbxProd.Image = Image.FromFile(@"C:\Users\Insane\Pictures\7z6vh4.jpg");
             PbxProd.Image = Image.FromFile(@"" + OFD1.FileName);
         }
         catch (Exception Ex)
         {
             MessageBox.Show(Ex.ToString());
         }
     }
 }