I want to make a directory hidden in Windows Vista. Not hidden completely just from view. Like you set from the folder options. I tried something along the lines of an example I saw. Only I modified it slightly..
Here is all of my code combined.
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 WindowsFormsApplication1
{
public partial class hideme : Form
{
public hideme()
{
InitializeComponent();
}
private void button3_Click(object sender, EventArgs e)
{
if (PasswordTextBox.Text == "test")
{
EnableButton.Visible = true;
DisableButton.Visible = true;
}
else
{
MessageBox.Show("Wrong", "Attention");
Application.Exit();
}
}
private void EnableButton_Click(object sender, EventArgs e)
{
//System.IO.FileInfo dir = new System.IO.FileInfo("C:\\Users\\logickills\\Pictures\\system");
string path = "C:\\Users\\chris\\Pictures\\system";
FileInfo FIh1 = new FileInfo(Environment.CurrentDirectory + @"\Files\File2.txt");
FIh1.Attributes = FileAttributes.Hidden;
}
private void DisableButton_Click(object sender, EventArgs e)
{
}
private void PasswordTextBox_TextChanged(object sender, EventArgs e)
{
}
}
}
This goes along with the dialog I was creating earlier here. The two buttons that are shown after password is entered is for showing and hiding that directory.
Thanks again SO.
(Sorry for so many posts I want to finish this program :D)