Click here to Skip to main content
15,891,981 members
Home / Discussions / C#
   

C#

 
AnswerRe: help with a loop to compare datatables Pin
pmarfleet15-Aug-07 10:26
pmarfleet15-Aug-07 10:26 
GeneralRe: help with a loop to compare datatables Pin
kboyette15-Aug-07 10:55
kboyette15-Aug-07 10:55 
AnswerRe: help with a loop to compare datatables [modified] Pin
Yosh_17-Aug-07 0:19
professionalYosh_17-Aug-07 0:19 
Question[C#] - Acess Control for directories Pin
aravinda77715-Aug-07 8:31
aravinda77715-Aug-07 8:31 
AnswerRe: [C#] - Acess Control for directories Pin
Dave Kreskowiak15-Aug-07 9:21
mveDave Kreskowiak15-Aug-07 9:21 
GeneralRe: [C#] - Acess Control for directories Pin
Scott Dorman15-Aug-07 13:51
professionalScott Dorman15-Aug-07 13:51 
GeneralRe: [C#] - Acess Control for directories Pin
Dave Kreskowiak15-Aug-07 16:10
mveDave Kreskowiak15-Aug-07 16:10 
AnswerRe: [C#] - Acess Control for directories Pin
PhilDanger15-Aug-07 10:59
PhilDanger15-Aug-07 10:59 
Disclaimer... not sure if this will work for your case -- this is the first time I've used this and I havn't really looked into it much.

Doing this I was able to restrict access to a directory that I had just created.

DirectoryInfo dirinfo = new DirectoryInfo(@".\mydir");
DirectorySecurity dirsec = new DirectorySecurity();
WindowsIdentity.GetCurrent().Name.ToString();
FileSystemAccessRule fsar = new FileSystemAccessRule(WindowsIdentity.GetCurrent().Name.ToString(), FileSystemRights.FullControl, AccessControlType.Deny); //Change to .Allow to allow full access
dirsec.SetAccessRule(fsar);
dirinfo.SetAccessControl(dirsec);


Basically this restricts it for the current user, but you can change it to the user name you'd like by replacing the WindowsIdentity name to whatever user you want.

Include these namespaces:

using System.IO;
using System.Security.AccessControl;
using System.Security.Principal;
QuestionJS script from C# Pin
vis200715-Aug-07 5:32
vis200715-Aug-07 5:32 
AnswerRe: JS script from C# Pin
led mike15-Aug-07 5:52
led mike15-Aug-07 5:52 
AnswerRe: JS script from C# Pin
Michael Sync15-Aug-07 6:26
Michael Sync15-Aug-07 6:26 
GeneralRe: JS script from C# Pin
Guffa15-Aug-07 6:58
Guffa15-Aug-07 6:58 
GeneralRe: JS script from C# Pin
Michael Sync15-Aug-07 7:07
Michael Sync15-Aug-07 7:07 
AnswerRe: JS script from C# Pin
Guffa15-Aug-07 14:00
Guffa15-Aug-07 14:00 
GeneralRe: JS script from C# Pin
Michael Sync15-Aug-07 16:29
Michael Sync15-Aug-07 16:29 
AnswerRe: JS script from C# Pin
Guffa15-Aug-07 21:36
Guffa15-Aug-07 21:36 
GeneralRe: JS script from C# Pin
Michael Sync16-Aug-07 1:22
Michael Sync16-Aug-07 1:22 
QuestionC++ to C#: Is it possible? Pin
Yosh_15-Aug-07 5:04
professionalYosh_15-Aug-07 5:04 
AnswerRe: C++ to C#: Is it possible? Pin
Phil J Pearson15-Aug-07 5:12
Phil J Pearson15-Aug-07 5:12 
GeneralRe: C++ to C#: Is it possible? Pin
Yosh_15-Aug-07 5:16
professionalYosh_15-Aug-07 5:16 
AnswerRe: C++ to C#: Is it possible? Pin
Dan Neely15-Aug-07 5:19
Dan Neely15-Aug-07 5:19 
GeneralRe: C++ to C#: Is it possible? Pin
Yosh_15-Aug-07 5:37
professionalYosh_15-Aug-07 5:37 
GeneralRe: C++ to C#: Is it possible? Pin
led mike15-Aug-07 5:51
led mike15-Aug-07 5:51 
AnswerRe: C++ to C#: Is it possible? Pin
Michael Sync15-Aug-07 6:36
Michael Sync15-Aug-07 6:36 
AnswerRe: C++ to C#: Is it possible? Pin
Judah Gabriel Himango15-Aug-07 7:59
sponsorJudah Gabriel Himango15-Aug-07 7:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.