Click here to Skip to main content
15,897,291 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
I wrote an HTTP server ,
When I run the HTTP server with visual studio(start debugging), it works ok. my responses are written correctly.
in my page, i write some .css and .js files that they are written correctly. and my page is loaded ok,

but
when i run by double click on "exe" file : the .css and .js files are written with errors, because The first file is written Date and Time string!

C++
<pre>Server: Microsoft-HTTPAPI/2.0
Date: Mon, 26 Aug 2013 05:17:58 GMT

... // text of .css or .js </pre>
What is the reason for this problem ?
Posted
Updated 25-Aug-13 19:44pm
v2

The main difference between running a program from visual studio in debugging mode and double-clicking the exe file is that your working directory will be a different one. In the first case it is the project directory or whatever your have specified in the project settings under the debugging tab. In the second case it is the directory in which your exe file resides. To check whether that is the reason for your complications move the exe file to your project directory and run it from there.
 
Share this answer
 
v2
Comments
Zon-cpp 26-Aug-13 2:06am    
project directory in project settings under the debugging tab is : $(TargetPath)
i moved the exe file to the project directory and run it, but it need to files that is in debug folder!
reason for my problem is not in 2 case, so what?
nv3 26-Aug-13 3:08am    
Thanks for voting my attempt to help you down. I won't try that again.
[no name] 26-Aug-13 4:26am    
I was going to post a comment about 2 types of ops that peeve me
1. down voting answers
2. adding their own (non) solutions
and then I find... oh well.
nv3 26-Aug-13 4:40am    
Thanks :-) Yes, some ops are outright bold.
project directory in project settings under the debugging tab is :
$(TargetPath)
i moved the exe file to the project directory and run it, but it need to files that is in debug folder! reason for my problem is not in 2 case, so what?
 
Share this answer
 
Comments
nv3 26-Aug-13 3:06am    
Please put that additional information under your question by using the "Improve question" link. Posting it as a solution won't do you any good.
mbue 26-Aug-13 3:38am    
you should use a configurable server path. with that path you are independant from your current directory. otherwise your server will be very unsafe.
regards.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900