示例#1
0
 public Texteditor(fichier f)
 {
     InitializeComponent();
     file = f;
     if (f.GetBlob() != null)
     {
         richTextBox1.Text = f.BinaryToText(f.GetBlob());
         oldtext           = richTextBox1.Text;
     }
 }
示例#2
0
        public void insertfilblob(fichier file)
        {
            string smt = "UPDATE Fichier SET blob = @blob  WHERE id = @id;";

            cmd = new SqlCommand(smt, conn);
            cmd.Parameters.AddWithValue("@blob", file.GetBlob());
            cmd.Parameters.AddWithValue("@id", file.Getid());


            cmd.ExecuteNonQuery();
        }
示例#3
0
        public Proprety(fichier f, Dossier d)
        {
            InitializeComponent();
            int size;

            if (f != null && d == null)
            {
                pictureBox1.BackgroundImage = imageList1.Images[1];
                textBox1.Text = f.GetNom().Trim() + "." + f.GetFormat().Trim();
                label4.Text   = f.GetFormat();

                if (f.GetBlob() != null)
                {
                    size = f.GetBlob().Length;
                }
                else
                {
                    size = 0;
                }

                label5.Text = size.ToString() + " Octets";
                label3.Text = null;
                label6.Text = null;
                label8.Text = f.GetDatecreation().ToString();
            }
            if (d != null && f == null)
            {
                pictureBox1.BackgroundImage = imageList1.Images[0];
                textBox1.Text = d.GetNom().Trim();
                label4.Text   = "Dossier";
                size          = d.Getlistoffiles().Count + d.Getlistofdir().Count;
                label5.Text   = size.ToString();
                label3.Text   = "Contains : ";
                label6.Text   = d.Getlistoffiles().Count + " files," + d.Getlistofdir().Count + " directorys";
                label8.Text   = d.GetDatecreation().ToString();
            }
        }