[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

C# Hidden Folder

Posted on 2015-01-14
3
Medium Priority
?
174 Views
Last Modified: 2015-01-28
I have already created EXE file and there is some text files in the folder.
I need to copy to CD (write to CD) to EXE file and Folder (With all text files). That folder i need to hidden/Invisible from Client.

Any one have any better idea how to that. Many Thanks
0
Comment
Question by:ukerandi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 40550277
That folder i need to hidden/Invisible from Client.
You do realize that clients can still "Show hidden files" in their Explorer window's options and see your files, yes? Assuming you're OK with that, then the files should copy over to CD with their "hidden" attribute in tact.
0
 
LVL 20

Expert Comment

by:Daniel Van Der Werken
ID: 40551737
Did kaufmed's answer resolve this?

Not sure what you're really going for here, so it's hard to know what to recommend. You can't really hide files from users if they have access to the system. You might be able to do some fancy tricks likes store them into an encrypted zip file or something, but I don't know.
0
 
LVL 11

Accepted Solution

by:
LordWabbit earned 2000 total points
ID: 40553501
You could also use alternate data streams on ntfs and when burning to disk change them to UDF named streams, there will still be a file, but it will have zero bytes, with all the data in the alternate data stream.  The following code uses a library that can be found here

        private static void CreateFileStream()
        {
            string filePath = System.IO.Path.Combine(location, "MyFile.txt");
            System.IO.File.WriteAllText(filePath, "");
            System.IO.FileInfo fileInfo = new System.IO.FileInfo(filePath);
            var alternateStream = fileInfo.GetAlternateDataStream("Hidden").OpenWrite();
            byte[] byteMe = System.Text.ASCIIEncoding.ASCII.GetBytes("This is how the world ends, not with a bang, but with a whimper.");
            alternateStream.Write(byteMe, 0, byteMe.Length);
        }

        private static void ReadFileStream()
        {
            string filePath = System.IO.Path.Combine(location, "MyFile.txt");
            System.IO.FileInfo fileInfo = new System.IO.FileInfo(filePath);
            var alternateStream = fileInfo.GetAlternateDataStream("Hidden").OpenRead();
            byte[] byteMe = new byte[alternateStream.Length];
            alternateStream.Read(byteMe, 0, byteMe.Length);
            string msg = System.Text.ASCIIEncoding.ASCII.GetString(byteMe);
            Console.WriteLine(msg);
        }

Open in new window

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question