|
-
August 12th, 2004, 12:20 PM
#1
Unrecognized escape sequence
Hi Can anyone suggest why am I getting ERROR (nrecognized escape sequence)
I am showing code where am I getting the error..
public static void Main()
{
Page.Response.ContentType = "C:\Documents and Settings\sshinde\My Documents\Visual Studio Projects\RSSFeed\RSSFeed\test.rss";
RSSFeedGenerator gen = new RSSFeedGenerator(Page.Response.Output);
gen.WriteStartDocument();
gen.WriteStartChannel("Developer Fusion RSS Feed","http://www.developerfusion.com/","Summary of the latest Articles Published on Developer Fusion","Copyright @ Developer Fusion","Shashi shinde");
gen.WriteItem("Using ADO.NET with SQL Server","http://www.developerfusion.com/show/4278/","An Extensive examination of using ADO.NET to access SQL Server databases, from establishing","Shashi shinde", DateTime.Now,".NET");
gen.WriteEndChannel();
gen.WriteEndDocument();
gen.Close();
}
Response would be appreciated.
Thanks a ton
Shash
-
August 12th, 2004, 12:29 PM
#2
Replace the line
Code:
Page.Response.ContentType = "C:\Documents and Settings\sshinde\My Documents\Visual Studio Projects\RSSFeed\RSSFeed\test.rss";
with
Code:
Page.Response.ContentType = @"C:\Documents and Settings\sshinde\My Documents\Visual Studio Projects\RSSFeed\RSSFeed\test.rss";
Remember that backslash in a string implies an escape sequence
Reality is the illusion created by lack of alcohol
-
August 12th, 2004, 12:44 PM
#3
You were right but now it shows following error.....
The type or namespace name 'Page' could not be found(are yo missing a using directive or an assembly refgerence?)
and the error is highlighted at following location
Page.Response.ContentType = @"C:\Documents and Settings\sshinde\My Documents\Visual Studio Projects\RSSFeed\RSSFeed\test.rss";
Can Anyone Give me their suggestions?
Appreciated..
Thanks a ton
Shash
-
August 12th, 2004, 01:11 PM
#4
Yes... as the error says, you are missing an assembly reference. The compiler doesn't know where this class or namespace Page is located, so you have to specify that yourself.
Reality is the illusion created by lack of alcohol
-
August 12th, 2004, 01:28 PM
#5
Regex cmdXpaths = new Regex(@"<\$(?<xpath>.*?)\$>");
What does above line mean?
I know Regex stands for regular Expression but not clear about rest of the part...
any suggestions?
thanks a ton
shash
-
August 13th, 2004, 01:45 AM
#6
(@"<\$(?<xpath>.*?)\$>")
implies... there is a string like...
mynewcode.test
here, when you perform match, you can retrieve the value using variable "xpath".
for example...
Code:
Regex m_regex = new Regex(@"<\$(?<xpath>.*?)\$>")
String s = @"mynewcode.test";
Match m = m_regex .Match(s);
if ( m.Success )
System.Console.WriteLine("User: " + m.Groups["xpath"].Value);
If you think you CAN, you can, If you think you CAN'T, you are probably right.
Have some nice Idea to share? Write an Article Online or Email to us and You may WIN a Technical Book from CG.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|