> using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace File_info
{
public partial class Form2: Form
{
public string fname;
public Form2 ()
{
InitializeComponent ();
}
private void button2_Click (object sender, EventArgs e)
{
this.Close ();
}
private void button1_Click (object sender, EventArgs e)
{
FileInfo fileinf = new FileInfo (fname);// Fileinf - об'єкт класу FileInfo
if (checkBox1.Checked == true)
{
fileinf.Attributes | = FileAttributes.Archive;// встановлюємо аттрибут
}
else
{
fileinf.Attributes ^ = FileAttributes.Archive;// знімаємо аттрибут
}
if (checkBox2.Checked == true)
{
fileinf.Attributes | = FileAttributes.Hidden;
}
else
{
fileinf.Attributes ^ = FileAttributes.Hidden;
}
if (checkBox3.Checked == true)
{
fileinf.Attributes | = FileAttributes.ReadOnly;
}
else
{
fileinf.Attributes ^ = FileAttributes.ReadOnly;
}
if (checkBox4.Checked == false)
{
fileinf.Attributes | = FileAttributes.NotContentIndexed;
}
else
{
fileinf.Attributes ^ = FileAttributes.NotContentIndexed;
}
if (checkBox5.Checked == true)
{
fileinf.Attributes | = FileAttributes.System;
}
else
{
fileinf.Attributes ^ = FileAttributes.System;
}
this.Close ();
В
}
private void checkBox1_CheckedChanged (object sender, EventArgs e)
{
}
}
}
В В
Form3.cs:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace File_info
{
public partial class Form3: Form
{
public bool change_name = false;
public Form3 ()
{
InitializeComponent ();
}
private void button1_Click (object sender, EventArgs e)
{
change_name = true;
this.Close ();
}
private void button2_Click (object sender, EventArgs e)
{
this.Close ();
}
private void label1_Click (object sender, EventArgs e)
{
}
private void textBox1_TextChanged (object sender, EventArgs e)