How to

set file to hidden

Published: 25. October 2011 | Updated: 25. October 2011
License: Microsoft Public License (MS-PL)
Categories: File system » Files
Tags: C# Windows
Was this snippet helpful for you? YESYES / NONO

Import namespace

using System.IO;

Code

string path = @"C:\Folder\test.txt";

File.SetAttributes(path, FileAttributes.Hidden);
Send us feedback about this snippet »



Related Snippets: