Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 4th, 2006, 10:04 AM
Registered User
 
Join Date: Feb 2006
Location: Gujranwala, Punjab, Pakistan.
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.

Reply With Quote
  #2 (permalink)  
Old February 4th, 2006, 11:00 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
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
Reply With Quote
  #3 (permalink)  
Old February 7th, 2006, 09:47 AM
Registered User
 
Join Date: Feb 2006
Location: Gujranwala, Punjab, Pakistan.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

Reply With Quote
  #4 (permalink)  
Old February 9th, 2006, 08:21 AM
Friend of Wrox
Points: 464, Level: 7
Points: 464, Level: 7 Points: 464, Level: 7 Points: 464, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2005
Location: Colombo, , Sri Lanka.
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 02:47 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.