Click here to Skip to main content
15,886,873 members
Home / Discussions / C#
   

C#

 
GeneralRe: Cannot Resolve Path Error Pin
ProEnggSoft16-Mar-12 14:42
ProEnggSoft16-Mar-12 14:42 
AnswerRe: Cannot Resolve Path Error Pin
PIEBALDconsult15-Mar-12 17:40
mvePIEBALDconsult15-Mar-12 17:40 
GeneralRe: Cannot Resolve Path Error Pin
ProEnggSoft16-Mar-12 14:44
ProEnggSoft16-Mar-12 14:44 
AnswerRe: Cannot Resolve Path Error Pin
BobJanova15-Mar-12 23:07
BobJanova15-Mar-12 23:07 
GeneralRe: Cannot Resolve Path Error Pin
Pete O'Hanlon15-Mar-12 23:29
mvePete O'Hanlon15-Mar-12 23:29 
GeneralRe: Cannot Resolve Path Error Pin
BobJanova16-Mar-12 0:57
BobJanova16-Mar-12 0:57 
GeneralRe: Cannot Resolve Path Error Pin
Pete O'Hanlon16-Mar-12 1:06
mvePete O'Hanlon16-Mar-12 1:06 
AnswerRe: Cannot Resolve Path Error Pin
V.16-Mar-12 2:01
professionalV.16-Mar-12 2:01 
It looks like you want to 'copy' a file from one directory to another. You give it 2 arguments: source and destination. correct?

In that case I would rather go for:
C#
byte[] data = File.ReadAllBytes(tempPath);

"C:\tempPath" denotes a directory ,not a file.

PS: note that the other comments are valid, the \ backslash character needs to be escaped as follows.
"C:\\tempPath\\"
//or
@"C:\tempPath\"
//I would not use this: "C:/tempPath/", the / character is used in URL's and might work confusing.


Another thing is see going wrong is this line:
C#
Console.WriteLine("Last byte: {0}", data[data.Length]);

//it should be
Console.WriteLine("Last byte: {0}", data[data.Length-1]);
//or it will give you an IndexOutOfBounsException


Hope this helps.
V.

AnswerRe: Cannot Resolve Path Error Pin
Luc Pattyn16-Mar-12 4:17
sitebuilderLuc Pattyn16-Mar-12 4:17 
GeneralRe: Cannot Resolve Path Error Pin
computerpublic16-Mar-12 11:46
computerpublic16-Mar-12 11:46 
GeneralRe: Cannot Resolve Path Error Pin
Richard Andrew x6416-Mar-12 13:11
professionalRichard Andrew x6416-Mar-12 13:11 
GeneralRe: Cannot Resolve Path Error Pin
ProEnggSoft16-Mar-12 14:50
ProEnggSoft16-Mar-12 14:50 
Questioncrone file Pin
altafmohd15-Mar-12 8:39
altafmohd15-Mar-12 8:39 
AnswerRe: crone file Pin
Dave Kreskowiak15-Mar-12 9:19
mveDave Kreskowiak15-Mar-12 9:19 
JokeRe: crone file Pin
Not Active15-Mar-12 9:44
mentorNot Active15-Mar-12 9:44 
GeneralRe: crone file Pin
altafmohd16-Mar-12 2:10
altafmohd16-Mar-12 2:10 
GeneralRe: crone file Pin
altafmohd16-Mar-12 2:11
altafmohd16-Mar-12 2:11 
AnswerRe: crone file Pin
Sebastian T Xavier15-Mar-12 19:49
Sebastian T Xavier15-Mar-12 19:49 
GeneralRe: crone file Pin
altafmohd16-Mar-12 2:07
altafmohd16-Mar-12 2:07 
QuestionCouldn't able to access functions in a web service reference Pin
NarVish15-Mar-12 0:58
NarVish15-Mar-12 0:58 
AnswerRe: Couldn't able to access functions in a web service reference Pin
dan!sh 15-Mar-12 1:30
professional dan!sh 15-Mar-12 1:30 
GeneralRe: Couldn't able to access functions in a web service reference Pin
NarVish15-Mar-12 1:43
NarVish15-Mar-12 1:43 
GeneralRe: Couldn't able to access functions in a web service reference Pin
dan!sh 15-Mar-12 1:44
professional dan!sh 15-Mar-12 1:44 
GeneralRe: Couldn't able to access functions in a web service reference Pin
NarVish15-Mar-12 2:13
NarVish15-Mar-12 2:13 
GeneralRe: Couldn't able to access functions in a web service reference Pin
NarVish15-Mar-12 2:55
NarVish15-Mar-12 2:55 

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.