Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hello all,

Anyone know how to open the security window on a file?

That's when you right click on a file and select Properties/Security...

 

I'm trying to do this using C# and I can't find any references.... :confused: :confused: :confused:

Thx,

fsX

Posted

I gave it a try and this API won't do the trick...

You can only preform these functions on a folder/file:

 

edit - Launches an editor and opens the document for editing.

find - Initiates a search starting from the specified directory.

open - Launches an application. If this file is not an executable file, its associated application is launched.

print - Prints the document file.

properties - Displays the object's properties.

 

fsX

Posted

Hi TripleB,

Thats not true...

On Windows servers by default you will always see the security tab, on Windows XP you need to remove 'Use simple file sharing' from Windows Explorer to see it.......

 

fsX

Posted

ok good to know but still,

 

If I use my code in save mode(because i didn't knew your answer) it I get the file properties AND the security tab so .....

Posted

It works fine for me too... but I want the program to run a little smoother and show the security tab right from the start; instead of clicking the security tab...

Don't want to confuse the end user....

 

fsX

Posted
look for some p/invoke code for GetFileVersionInfo and GetFileVersionInfoSize and build your own display

Joe Mamma

Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized.

Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.

Posted

Hi Joe Mamma,

 

look for some p/invoke code for GetFileVersionInfo and GetFileVersionInfoSize and build your own display

How could you use this to see the NTFS security?

 

fsX

Posted
Hi Joe Mamma,

 

 

How could you use this to see the NTFS security?

 

fsX

I didnt read your post closely enough. . . give me a few theres a different api call for this. . . one moment

Joe Mamma

Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized.

Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.

Posted

You want GetNamedSecurityInfo P/Invoke -

 

http://www.pinvoke.net/default.aspx/advapi32.GetNamedSecurityInfo

 

haven't tried it but it looks right

Joe Mamma

Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized.

Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...