Click here to Skip to main content
15,892,809 members
Home / Discussions / C#
   

C#

 
AnswerRe: Copying file error. Pin
Bert delaVega23-Jun-08 3:23
Bert delaVega23-Jun-08 3:23 
GeneralRe: Copying file error. Pin
asma_panjabi23-Jun-08 3:47
asma_panjabi23-Jun-08 3:47 
GeneralRe: Copying file error. Pin
Alan Balkany23-Jun-08 5:27
Alan Balkany23-Jun-08 5:27 
AnswerRe: Copying file error. Pin
Alan Balkany23-Jun-08 3:27
Alan Balkany23-Jun-08 3:27 
GeneralRe: Copying file error. Pin
asma_panjabi23-Jun-08 3:48
asma_panjabi23-Jun-08 3:48 
AnswerRe: Copying file error. Pin
Luc Pattyn23-Jun-08 3:33
sitebuilderLuc Pattyn23-Jun-08 3:33 
GeneralRe: Copying file error. Pin
asma_panjabi23-Jun-08 3:49
asma_panjabi23-Jun-08 3:49 
RantRe: Copying file error. Pin
Spacix One23-Jun-08 4:00
Spacix One23-Jun-08 4:00 
More of a FYI than an answer , but you should always put the checked for value first:
if (DialogResult.OK == openFileDialog1.ShowDialog())
{
    string filename = System.IO.Path.GetFileName(openFileDialog1.FileName);
    string fname = Application.StartupPath + "\\Temp\\" + filename;
    File.Copy(openFileDialog1.FileName, fname, true);
}


that way if you mess up and only type one = you'll get an error during compile.
This show what I mean:
int num = 3;
if (num = 4)
{
    //num will be equal to 4 and this block always executes
}
vs
int num = 3;
if (4 = num)
{
    //You could never build this file without an error because you can't assign to an int value
}



-Spacix
All your skynet questions[^] belong to solved

I dislike the black-and-white voting system on questions/answers. Dead | X|

AnswerRe: Copying file error. Pin
leppie23-Jun-08 4:11
leppie23-Jun-08 4:11 
GeneralRe: Copying file error. Pin
asma_panjabi23-Jun-08 19:26
asma_panjabi23-Jun-08 19:26 
AnswerRe: Copying file error. Pin
asma_panjabi23-Jun-08 21:36
asma_panjabi23-Jun-08 21:36 
QuestionDataGridView copy Pin
V.23-Jun-08 2:28
professionalV.23-Jun-08 2:28 
AnswerRe: DataGridView copy Pin
Harvey Saayman23-Jun-08 2:48
Harvey Saayman23-Jun-08 2:48 
GeneralRe: DataGridView copy Pin
V.23-Jun-08 2:52
professionalV.23-Jun-08 2:52 
GeneralRe: DataGridView copy Pin
Harvey Saayman23-Jun-08 2:57
Harvey Saayman23-Jun-08 2:57 
GeneralRe: DataGridView copy Pin
V.23-Jun-08 3:02
professionalV.23-Jun-08 3:02 
GeneralRe: DataGridView copy Pin
Harvey Saayman23-Jun-08 3:05
Harvey Saayman23-Jun-08 3:05 
QuestionValidation List<t> object</t> Pin
RichardContact-123-Jun-08 2:08
RichardContact-123-Jun-08 2:08 
AnswerRe: Validation List object Pin
N a v a n e e t h23-Jun-08 2:16
N a v a n e e t h23-Jun-08 2:16 
AnswerRe: Validation List object Pin
Giorgi Dalakishvili23-Jun-08 2:24
mentorGiorgi Dalakishvili23-Jun-08 2:24 
Questiondouble buffer question Pin
Harvey Saayman23-Jun-08 2:05
Harvey Saayman23-Jun-08 2:05 
AnswerRe: double buffer question Pin
Christian Graus23-Jun-08 2:25
protectorChristian Graus23-Jun-08 2:25 
GeneralRe: double buffer question Pin
Harvey Saayman23-Jun-08 2:33
Harvey Saayman23-Jun-08 2:33 
GeneralRe: double buffer question Pin
Ed.Poore23-Jun-08 3:28
Ed.Poore23-Jun-08 3:28 
GeneralRe: double buffer question Pin
Harvey Saayman23-Jun-08 4:18
Harvey Saayman23-Jun-08 4:18 

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.