Click here to Skip to main content
15,913,280 members
Home / Discussions / C#
   

C#

 
AnswerRe: how would you change your bindingsource for a textbox programmably Pin
Gaurav Dudeja India10-Feb-10 17:22
Gaurav Dudeja India10-Feb-10 17:22 
GeneralRe: how would you change your bindingsource for a textbox programmably Pin
tonyonlinux10-Feb-10 17:32
tonyonlinux10-Feb-10 17:32 
GeneralRe: how would you change your bindingsource for a textbox programmably Pin
tonyonlinux10-Feb-10 18:13
tonyonlinux10-Feb-10 18:13 
QuestionMoving a file from a CD to a Folder somewhere on hardrive Pin
shadowthief_0310-Feb-10 9:12
shadowthief_0310-Feb-10 9:12 
AnswerRe: Moving a file from a CD to a Folder somewhere on hardrive Pin
Keith Barrow10-Feb-10 9:15
professionalKeith Barrow10-Feb-10 9:15 
GeneralRe: Moving a file from a CD to a Folder somewhere on hardrive Pin
shadowthief_0310-Feb-10 9:53
shadowthief_0310-Feb-10 9:53 
GeneralRe: Moving a file from a CD to a Folder somewhere on hardrive Pin
Keith Barrow10-Feb-10 10:08
professionalKeith Barrow10-Feb-10 10:08 
GeneralRe: Moving a file from a CD to a Folder somewhere on hardrive Pin
shadowthief_0310-Feb-10 10:35
shadowthief_0310-Feb-10 10:35 
yes i have tried the File.Copy and the File.Move. i know the way i did them is right because if i run my program with the file on the C: drive and not a CD then it works. but when i try to get the file to copy or move from CD which happens to be my E: drive i get the error.

decryption failed Access to the path E:\bb.zip.dpa is denied.

if i have my encrypted file anywhere but on my CD then my program works fine. below is my code for when i open the file with a file browser dialog and here i try to copy the file. also i point out where it breaks and throws the Access is denied error

private void btnOpen_Click(object sender, EventArgs e)
       {
           ofdMain.Title = "Select file to Decrypt";
           ofdMain.Filter = "Crypt files (*.dpa)|*.dpa";

           if (ofdMain.ShowDialog() == DialogResult.OK)
           {
               txtBoxDecrypt.Text = ofdMain.FileName;

               OutputFileNameDe();


       string path = txtBoxDecrypt.Text;
       string path2 = @"c:\temp2\MyTest.txt";
       try
       {
           if (!File.Exists(path))
           {
               // This statement ensures that the file is created,
               // but the handle is not kept.
               using (FileStream fs = File.Create(path)) {}
           }

           // Ensure that the target does not exist.
           if (File.Exists(path2))
           File.Delete(path2);

           // Move the file.
           //breaks here!!!!!!!!!!!
           File.Move(path, path2);
           Console.WriteLine("{0} was moved to {1}.", path, path2);

           // See if the original exists now.
           if (File.Exists(path))
           {
               Console.WriteLine("The original file still exists, which is unexpected.");
           }
           else
           {
               Console.WriteLine("The original file no longer exists, which is expected.");
           }

       }
       catch (Exception ex)
       {
           Console.WriteLine("The process failed: {0}", ex.ToString());
       }



           }
       }



thanks again for all your help, if i need to provide anything else let me know.
GeneralRe: Moving a file from a CD to a Folder somewhere on hardrive Pin
Keith Barrow10-Feb-10 11:21
professionalKeith Barrow10-Feb-10 11:21 
GeneralRe: Moving a file from a CD to a Folder somewhere on hardrive Pin
shadowthief_0310-Feb-10 10:53
shadowthief_0310-Feb-10 10:53 
GeneralRe: Moving a file from a CD to a Folder somewhere on hardrive Pin
Eddy Vluggen10-Feb-10 11:14
professionalEddy Vluggen10-Feb-10 11:14 
GeneralRe: Moving a file from a CD to a Folder somewhere on hardrive Pin
shadowthief_0310-Feb-10 11:24
shadowthief_0310-Feb-10 11:24 
GeneralRe: Moving a file from a CD to a Folder somewhere on hardrive Pin
Keith Barrow10-Feb-10 11:38
professionalKeith Barrow10-Feb-10 11:38 
GeneralRe: Moving a file from a CD to a Folder somewhere on hardrive Pin
shadowthief_0310-Feb-10 11:56
shadowthief_0310-Feb-10 11:56 
GeneralRe: Moving a file from a CD to a Folder somewhere on hardrive Pin
Eddy Vluggen10-Feb-10 12:00
professionalEddy Vluggen10-Feb-10 12:00 
QuestionHow to Load & Save to val's in app.config file ? Pin
Gali197810-Feb-10 7:59
Gali197810-Feb-10 7:59 
AnswerRe: How to Load & Save to val's in app.config file ? Pin
Dan Mos10-Feb-10 8:27
Dan Mos10-Feb-10 8:27 
QuestionUserControl Designer Support Pin
Andy Braham10-Feb-10 7:32
Andy Braham10-Feb-10 7:32 
Questionwant code Pin
ajay 201010-Feb-10 7:08
ajay 201010-Feb-10 7:08 
AnswerMessage Closed Pin
10-Feb-10 7:31
stancrm10-Feb-10 7:31 
GeneralRe: want code Pin
ajay 201011-Feb-10 1:09
ajay 201011-Feb-10 1:09 
AnswerRe: want code Pin
Dan Mos10-Feb-10 7:31
Dan Mos10-Feb-10 7:31 
GeneralRe: want code Pin
ajay 201011-Feb-10 1:16
ajay 201011-Feb-10 1:16 
GeneralRe: want code Pin
ajay 201011-Feb-10 1:20
ajay 201011-Feb-10 1:20 
GeneralRe: want code Pin
ajay 201011-Feb-10 1:21
ajay 201011-Feb-10 1:21 

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.