|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Seeting File AttrubitesHi EveryBody:
I want to set the file attribute to Hidden and readOnly proprty by using this: System.IO.File.SetAttributes("C:\windows98\windowsdll\win32app\direction\home", FileAttributes.ReadOnly) System.IO.File.SetAttributes("C:\windows98\windowsdll\win32app\direction\kernel32dll", FileAttributes.Hidden) But i foucs that: when I run my program it just take the last attributes, which is hidden and ignor readonly, I want to set the both property to one file, How can I do that ? any help will be appreciated regard's Husam Husam wrote:
Show quoteHide quote > Hi EveryBody: Not tested but try:> > I want to set the file attribute to Hidden and readOnly proprty by using > this: > > System.IO.File.SetAttributes("C:\windows98\windowsdll\win32app\direction\home", FileAttributes.ReadOnly) > > System.IO.File.SetAttributes("C:\windows98\windowsdll\win32app\direction\kernel32dll", FileAttributes.Hidden) > But i foucs that: > > when I run my program it just take the last attributes, which is hidden and > ignor readonly, I want to set the both property to one file, How can I do > that ? > > any help will be appreciated > > regard's > > Husam System.IO.File.SetAttributes("C:\windows98\windowsdll\win32app\direction\kernel32dll", FileAttributes.Hidden Or FileAttributes.ReadOnly) Chris
Show quote
Hide quote
"Husam" <Hu***@discussions.microsoft.com> schrieb: First, you are setting the attributes on different files/folders. Second, > I want to set the file attribute to Hidden and readOnly proprty by using > this: > > System.IO.File.SetAttributes("C:\windows98\windowsdll\win32app\direction\home", > FileAttributes.ReadOnly) > > System.IO.File.SetAttributes("C:\windows98\windowsdll\win32app\direction\kernel32dll", > FileAttributes.Hidden) > But i foucs that: > > when I run my program it just take the last attributes, which is hidden > and > ignor readonly, I want to set the both property to one file, How can I do > that ? you may want to preserve existing arguments and combine 'ReadOnly' and 'Hidden': \\\ Imports System.IO .. .. .. File.SetAttributes( _ FileName, _ File.GetAttributes(FileName) Or _ FileAttributes.Hidden Or _ FileAttributes.ReadOnly _ ) /// Related: <URL:http://groups.google.de/groups?selm=OduQMSILFHA.4028%40tk2msftngp13.phx.gbl> -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/>
Determine if "Hide extensions for known file types" is active
Need help updating table retrive record ID on insert Go to URL on Button_Click What scope is best for defining Enum type? Selecting specific columns from a dataview? Question about Destructors Errors when translating CultureInfo from C# to VB mysql date format Simple Reflection Question |
|||||||||||||||||||||||