Hi wakil,
I hope this is what you wanted.
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Text;
private void btnHide_Click(object sender, System.EventArgs e)
{
string path = @"c:\nalla.txt";
if (!File.Exists(path))
{
File.Create(path);
}
File.SetAttributes(path, FileAttributes.Hidden);
MessageBox.Show("The " + path + "file is hidden.");
}
private void btnShow_Click(object sender, System.EventArgs e)
{
string path = @"c:\nalla.txt";
if (!File.Exists(path))
{
File.Create(path);
}
File.SetAttributes(path, FileAttributes.Normal);
MessageBox.Show("The " + path + "file is no longer hidden.");
}
}
nalaka hewage
|