Click here to Skip to main content
15,900,258 members
Home / Discussions / C#
   

C#

 
AnswerRe: call an opener form method Pin
Paladin20005-Jan-11 7:33
Paladin20005-Jan-11 7:33 
JokeRe: call an opener form method Pin
fjdiewornncalwe5-Jan-11 9:32
professionalfjdiewornncalwe5-Jan-11 9:32 
AnswerRe: call an opener form method Pin
Paladin20005-Jan-11 7:39
Paladin20005-Jan-11 7:39 
QuestionGet image from resource Pin
csrss5-Jan-11 1:38
csrss5-Jan-11 1:38 
AnswerRe: Get image from resource Pin
RaviRanjanKr5-Jan-11 1:51
professionalRaviRanjanKr5-Jan-11 1:51 
AnswerRe: Get image from resource Pin
JF20155-Jan-11 1:54
JF20155-Jan-11 1:54 
GeneralRe: Get image from resource Pin
csrss5-Jan-11 2:31
csrss5-Jan-11 2:31 
QuestionGetting Permisions Pin
Wamuti4-Jan-11 23:13
Wamuti4-Jan-11 23:13 
Hi all. When i try accessing drive C: where the O.S.(windows 7), i keep on getting the error:

Access to the path 'C:\Documents and Settings\' is denied. and throws the Exception:

I have a good idea i have the following piece of code

private static void CopyFiles(string directoryPath, string destination)
        {
            try
            {
                int count = 0;
                DirectoryInfo dir = new DirectoryInfo(directoryPath);
             //   DirectorySecurity dSecurity = dir.GetAccessControl();
              //  dSecurity.AddAccessRule(new FileSystemAccessRule(??);
               FileInfo[] wordFiles = dir.GetFiles("*.doc*", SearchOption.AllDirectories);
                foreach (FileInfo f in wordFiles)
                {

                    count++;
                    f.CopyTo(destination + count.ToString() + f.Name);
                    Console.WriteLine("***************************");

                    Console.WriteLine("File name: {0} Copied", f.Name);

                    Console.WriteLine("***************************\n");



                }


            }
            catch (UnauthorizedAccessException ex)
            {
 
            }
        }

I tried to request permisions in the two commented lines but i was totally unable. Please assist. Frown | :-( .
Wamuti: Any man can be an island, but islands to need water around them!
Edmund Burke: No one could make a greater mistake than he who did nothing because he could do only a little.

AnswerRe: Getting Permisions [modified] Pin
RaviRanjanKr4-Jan-11 23:53
professionalRaviRanjanKr4-Jan-11 23:53 
AnswerRe: Getting Permisions Pin
Luc Pattyn5-Jan-11 2:45
sitebuilderLuc Pattyn5-Jan-11 2:45 
GeneralRe: Getting Permisions Pin
Wamuti8-Jan-11 3:21
Wamuti8-Jan-11 3:21 
GeneralRe: Getting Permisions Pin
Luc Pattyn8-Jan-11 3:29
sitebuilderLuc Pattyn8-Jan-11 3:29 
Generaltest (just ignore) Pin
Luc Pattyn13-Jan-11 9:39
sitebuilderLuc Pattyn13-Jan-11 9:39 
Generaltest (just ignore) Pin
Luc Pattyn13-Jan-11 9:39
sitebuilderLuc Pattyn13-Jan-11 9:39 
Generaltest (just ignore) [modified] Pin
Luc Pattyn13-Jan-11 9:40
sitebuilderLuc Pattyn13-Jan-11 9:40 
Generaltest (just ignore) Pin
Luc Pattyn13-Jan-11 9:56
sitebuilderLuc Pattyn13-Jan-11 9:56 
QuestionQuiz Application In c#.net Pin
varun.g4-Jan-11 23:03
varun.g4-Jan-11 23:03 
AnswerRe: Quiz Application In c#.net Pin
JF20154-Jan-11 23:16
JF20154-Jan-11 23:16 
GeneralRe: Quiz Application In c#.net Pin
varun.g4-Jan-11 23:33
varun.g4-Jan-11 23:33 
GeneralRe: Quiz Application In c#.net Pin
JF20155-Jan-11 2:05
JF20155-Jan-11 2:05 
GeneralRe: Quiz Application In c#.net Pin
varun.g5-Jan-11 16:48
varun.g5-Jan-11 16:48 
QuestionbackgroundWorker Pin
arkiboys4-Jan-11 22:34
arkiboys4-Jan-11 22:34 
AnswerRe: backgroundWorker Pin
JF20154-Jan-11 22:39
JF20154-Jan-11 22:39 
AnswerRe: backgroundWorker Pin
Pete O'Hanlon4-Jan-11 22:41
mvePete O'Hanlon4-Jan-11 22:41 
GeneralRe: backgroundWorker Pin
arkiboys4-Jan-11 23:17
arkiboys4-Jan-11 23:17 

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.