Click here to Skip to main content
15,881,281 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

I am calling a C#.net exe(sendmail.exe) from the command file which passes the parameter to it and an email will be sent to me from the exe displaying the paramet content in the body of the email.

the parameter is directory that will vary based on the server i am running (eg:\\nas*)

whenever i pass this parameter to the exe it is taking \n as new line character and
something as below is printing. the server name is \\na1234567 i am passing the same parameter to the exe.
CSS
\
aa1234567

Could some please let me know what can i modify in the command file from where i am passing the parameter so that \n wont be considered as new line character in the exe and \\na1234567 is displayed in the body of the email ?
Posted
Updated 19-Apr-13 11:16am
v2
Comments
CHill60 6-Dec-12 7:03am    
do you have the code for sendmail.exe?

use @ like it..
C#
String str= @"something \n something"


accept and rate solution if it is helpfull.
Regards:
sumi
 
Share this answer
 
v2
Comments
anupama962010 6-Dec-12 6:35am    
i am passing parameter as set parameter=%directory% which is \\na1234567 from the command file. If i put parameter=@"%directory%" then it is not recognising the path.It says path not found
lewax00 19-Apr-13 18:28pm    
Read his question more carefully, he says he's calling it from the command line. C# syntax won't help.
C#
string hello = "\u0048\u0065\u006C\u006C\u006F";
Console.Write ("\t" + hello + "!\n");            // "    Hello!"



try like this...

Happy coding:)
 
Share this answer
 
This is not a solution, OP posted a question and has been told to refrain.
 
Share this answer
 
v2
Comments
Richard C Bishop 19-Apr-13 17:15pm    
Be sure to not post questions or comments as solutions to your own thread.
lewax00 19-Apr-13 18:30pm    
There is a report for that, "Not an Answer". It helps keep clean these out.

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