Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 4th, 2006, 10:04 AM
Registered User
 
Join Date: Feb 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Solve my problem first?

How to make a software in c# that hides a given folder and also can unhide.

 
Old February 4th, 2006, 11:00 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

You are going to have to provide more detail than that.

Do you mean that you want to write something that will modify a folders file system properties such that the file becomes hidden?

-Peter
 
Old February 7th, 2006, 09:47 AM
Registered User
 
Join Date: Feb 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes, i want to modify file or folder so that it becomes hidden.

 
Old February 9th, 2006, 08:21 AM
Friend of Wrox
 
Join Date: Dec 2005
Posts: 132
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to nalla Send a message via Yahoo to nalla
Default



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





Similar Threads
Thread Thread Starter Forum Replies Last Post
Please help me to solve these two problem khatu_jec C# 4 January 3rd, 2008 08:41 AM
Need help to solve problem PankajMishra XSLT 7 April 19th, 2007 08:27 AM
Will you please help me to solve this problem....? vis_kapadia Excel VBA 2 November 22nd, 2006 04:57 AM
Solve the problem chandan_tandon General .NET 0 October 4th, 2006 07:00 AM
could you solve my problem? Robin1 Javascript 0 September 13th, 2004 10:13 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.