473,657 Members | 2,800 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ht insert one double quote?

I am writing an app that enables a user to reply to a newsgroup.

The proper syntax for From: is

"screen name" em***@address.c om

and over all, it should look like:

--

From: "screen name" em***@address.c om
Subject: mySubject
Date: Tuesday, September 25, 2007 8:51 AM

body goes here . . . .

--

Problems #1: in this app, ScreenName is a variable that does not have
either beginning or ending double quotes. How do I insert/append the
beginning and ending double quotes?

Problem#2: how do I insert/append a line feed in the text feed to the
server so that the text does not have \n\r in it?

Right now, the best I can do using StringBuilder's Append and AppendFormat
is:

--

From: screen name em***@address.c om\n\rSubject: mySubject\n\rDa te: Tuesday,
September 25, 2007 8:51 AM\n\r\n\rbody goes here . . . .

--
Thank you
Sep 25 '07 #1
5 2331
xzzy,

You can just use escaped quotes, like so:

string quoted = "\"" + screenName + "\"";

As for appending a line feed to send to the server, and you use \r\n
without the "@" before your string, then a line feed/new line combo will be
sent to the server, not the literal string "\r\n".
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"xzzy" <mr********@com cast.netwrote in message
news:V5******** *************** *******@comcast .com...
>I am writing an app that enables a user to reply to a newsgroup.

The proper syntax for From: is

"screen name" em***@address.c om

and over all, it should look like:

--

From: "screen name" em***@address.c om
Subject: mySubject
Date: Tuesday, September 25, 2007 8:51 AM

body goes here . . . .

--

Problems #1: in this app, ScreenName is a variable that does not have
either beginning or ending double quotes. How do I insert/append the
beginning and ending double quotes?

Problem#2: how do I insert/append a line feed in the text feed to the
server so that the text does not have \n\r in it?

Right now, the best I can do using StringBuilder's Append and AppendFormat
is:

--

From: screen name em***@address.c om\n\rSubject: mySubject\n\rDa te:
Tuesday, September 25, 2007 8:51 AM\n\r\n\rbody goes here . . . .

--
Thank you

Sep 25 '07 #2
Nicholas, thank you for your time and effort with this problem.

When I do:
StringBuilder sb = new StringBuilder() ;

string xname = "\"" + yScreenName + "\"";

sb.Append(xname + " ");

sb.Append("<");

sb.Append(yUID) ;

sb.Append(">");

the result is:

"\"xzzy\" <na**@provider. net>"

I can connect the news server and the news group and download posts, but
when trying to post to the NG, this error message occurs:

Unable to read data from the transport connection.

which I have searched and found to mean that the "From:" address is not
being accepted

I am currently "stumped" and dead in the water on this.

I thank you for any help you can provide.
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c omwrote in
message news:OC******** ******@TK2MSFTN GP06.phx.gbl...
xzzy,

You can just use escaped quotes, like so:

string quoted = "\"" + screenName + "\"";

As for appending a line feed to send to the server, and you use \r\n
without the "@" before your string, then a line feed/new line combo will
be sent to the server, not the literal string "\r\n".
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"xzzy" <mr********@com cast.netwrote in message
news:V5******** *************** *******@comcast .com...
>>I am writing an app that enables a user to reply to a newsgroup.

The proper syntax for From: is

"screen name" em***@address.c om

and over all, it should look like:

--

From: "screen name" em***@address.c om
Subject: mySubject
Date: Tuesday, September 25, 2007 8:51 AM

body goes here . . . .

--

Problems #1: in this app, ScreenName is a variable that does not have
either beginning or ending double quotes. How do I insert/append the
beginning and ending double quotes?

Problem#2: how do I insert/append a line feed in the text feed to the
server so that the text does not have \n\r in it?

Right now, the best I can do using StringBuilder's Append and
AppendFormat is:

--

From: screen name em***@address.c om\n\rSubject: mySubject\n\rDa te:
Tuesday, September 25, 2007 8:51 AM\n\r\n\rbody goes here . . . .

--
Thank you


Sep 26 '07 #3
xzzy,

Where are you looking at the result from, in the debugger? If so, then
the debugger is going to show you the string with the escape characters, but
that is not the literal string in memory. Did you use the text debugger
visualizer? It will show you the quotes in memory.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"xzzy" <mr********@com cast.netwrote in message
news:Ia******** *************** *******@comcast .com...
Nicholas, thank you for your time and effort with this problem.

When I do:
StringBuilder sb = new StringBuilder() ;

string xname = "\"" + yScreenName + "\"";

sb.Append(xname + " ");

sb.Append("<");

sb.Append(yUID) ;

sb.Append(">");

the result is:

"\"xzzy\" <na**@provider. net>"

I can connect the news server and the news group and download posts, but
when trying to post to the NG, this error message occurs:

Unable to read data from the transport connection.

which I have searched and found to mean that the "From:" address is not
being accepted

I am currently "stumped" and dead in the water on this.

I thank you for any help you can provide.
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c omwrote
in message news:OC******** ******@TK2MSFTN GP06.phx.gbl...
>xzzy,

You can just use escaped quotes, like so:

string quoted = "\"" + screenName + "\"";

As for appending a line feed to send to the server, and you use \r\n
without the "@" before your string, then a line feed/new line combo will
be sent to the server, not the literal string "\r\n".
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"xzzy" <mr********@com cast.netwrote in message
news:V5******* *************** ********@comcas t.com...
>>>I am writing an app that enables a user to reply to a newsgroup.

The proper syntax for From: is

"screen name" em***@address.c om

and over all, it should look like:

--

From: "screen name" em***@address.c om
Subject: mySubject
Date: Tuesday, September 25, 2007 8:51 AM

body goes here . . . .

--

Problems #1: in this app, ScreenName is a variable that does not have
either beginning or ending double quotes. How do I insert/append the
beginning and ending double quotes?

Problem#2: how do I insert/append a line feed in the text feed to the
server so that the text does not have \n\r in it?

Right now, the best I can do using StringBuilder's Append and
AppendForma t is:

--

From: screen name em***@address.c om\n\rSubject: mySubject\n\rDa te:
Tuesday, September 25, 2007 8:51 AM\n\r\n\rbody goes here . . . .

--
Thank you



Sep 26 '07 #4

"xzzy" <mr********@com cast.netwrote in message
news:Ia******** *************** *******@comcast .com...
Nicholas, thank you for your time and effort with this problem.

When I do:
StringBuilder sb = new StringBuilder() ;

string xname = "\"" + yScreenName + "\"";

sb.Append(xname + " ");

sb.Append("<");

sb.Append(yUID) ;

sb.Append(">");

the result is:

"\"xzzy\" <na**@provider. net>"

I can connect the news server and the news group and download posts, but
when trying to post to the NG, this error message occurs:

Unable to read data from the transport connection.

which I have searched and found to mean that the "From:" address is not
being accepted
I really doubt the error message you mention means that. It sounds as if
the connection was dropped, which could be a network error or could be
intentionally done by the other end.

The other end might intentionally drop the connection if your data was in
the correct format, but matched a blacklist (or didn't match a whitelist).
Badly formatted data would be more likely to give an error message.

I'm speaking from my knowledge of SMTP and HTTP, and I presume NNTP would
work very similarly.
>
I am currently "stumped" and dead in the water on this.

I thank you for any help you can provide.
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c omwrote
in message news:OC******** ******@TK2MSFTN GP06.phx.gbl...
>xzzy,

You can just use escaped quotes, like so:

string quoted = "\"" + screenName + "\"";

As for appending a line feed to send to the server, and you use \r\n
without the "@" before your string, then a line feed/new line combo will
be sent to the server, not the literal string "\r\n".
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"xzzy" <mr********@com cast.netwrote in message
news:V5******* *************** ********@comcas t.com...
>>>I am writing an app that enables a user to reply to a newsgroup.

The proper syntax for From: is

"screen name" em***@address.c om

and over all, it should look like:

--

From: "screen name" em***@address.c om
Subject: mySubject
Date: Tuesday, September 25, 2007 8:51 AM

body goes here . . . .

--

Problems #1: in this app, ScreenName is a variable that does not have
either beginning or ending double quotes. How do I insert/append the
beginning and ending double quotes?

Problem#2: how do I insert/append a line feed in the text feed to the
server so that the text does not have \n\r in it?

Right now, the best I can do using StringBuilder's Append and
AppendForma t is:

--

From: screen name em***@address.c om\n\rSubject: mySubject\n\rDa te:
Tuesday, September 25, 2007 8:51 AM\n\r\n\rbody goes here . . . .

--
Thank you



Sep 26 '07 #5
Nicholas thank you for your help with getting the string properly formatted.

Ben, I think your comment about the ISP deliberately dropping the connection
may be an issue
..
The app I am writing enables a user to have one stop shopping for
information, regardless of the information's type or location, and it
automatically organizes the information into user defined "Topics".
Probably testing the app upset the newsgroup provider as I have never had a
problem with any other newserver, email server provider, provider of
pictures, files, media, . . .

This particular newsgroup provider is about 4 miles from here, guess I'll
have to wear a suit for a couple hours.
Thank you,

John Bickmore

"Ben Voigt [C++ MVP]" <rb*@nospam.nos pamwrote in message
news:eP******** ******@TK2MSFTN GP02.phx.gbl...
>
"xzzy" <mr********@com cast.netwrote in message
news:Ia******** *************** *******@comcast .com...
>Nicholas, thank you for your time and effort with this problem.

When I do:
StringBuilde r sb = new StringBuilder() ;

string xname = "\"" + yScreenName + "\"";

sb.Append(xnam e + " ");

sb.Append("<") ;

sb.Append(yUID );

sb.Append(">") ;

the result is:

"\"xzzy\" <na**@provider. net>"

I can connect the news server and the news group and download posts, but
when trying to post to the NG, this error message occurs:

Unable to read data from the transport connection.

which I have searched and found to mean that the "From:" address is not
being accepted

I really doubt the error message you mention means that. It sounds as if
the connection was dropped, which could be a network error or could be
intentionally done by the other end.

The other end might intentionally drop the connection if your data was in
the correct format, but matched a blacklist (or didn't match a whitelist).
Badly formatted data would be more likely to give an error message.

I'm speaking from my knowledge of SMTP and HTTP, and I presume NNTP would
work very similarly.
>>
I am currently "stumped" and dead in the water on this.

I thank you for any help you can provide.
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c omwrote
in message news:OC******** ******@TK2MSFTN GP06.phx.gbl...
>>xzzy,

You can just use escaped quotes, like so:

string quoted = "\"" + screenName + "\"";

As for appending a line feed to send to the server, and you use \r\n
without the "@" before your string, then a line feed/new line combo will
be sent to the server, not the literal string "\r\n".
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"xzzy" <mr********@com cast.netwrote in message
news:V5****** *************** *********@comca st.com...
I am writing an app that enables a user to reply to a newsgroup.

The proper syntax for From: is

"screen name" em***@address.c om

and over all, it should look like:

--

From: "screen name" em***@address.c om
Subject: mySubject
Date: Tuesday, September 25, 2007 8:51 AM

body goes here . . . .

--

Problems #1: in this app, ScreenName is a variable that does not have
either beginning or ending double quotes. How do I insert/append the
beginning and ending double quotes?

Problem#2: how do I insert/append a line feed in the text feed to the
server so that the text does not have \n\r in it?

Right now, the best I can do using StringBuilder's Append and
AppendForm at is:

--

From: screen name em***@address.c om\n\rSubject: mySubject\n\rDa te:
Tuesday, September 25, 2007 8:51 AM\n\r\n\rbody goes here . . . .

--
Thank you



Sep 26 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
2290
by: deancoo | last post by:
I have gotten into the habit of often using copy along with an insert iterator. There are scenarios where I process quite a lot of data this way. Can someone give me a general feel as to how much of a performance hit I'm taking using this technique versus using 'copy' to copy directly into a container with elements in place? Thanks, d
1
5613
by: soni29 | last post by:
hi, just wanted to know if i need to insert a string with double quotes in it into a sql server table, do i need to use any delimeters, like \"? an insert like: insert into producttable values(key, "double quote text") where i need the "double quote text" to go in like that, with the " " at both ends. Thank you.
3
3096
by: Jason | last post by:
I have several tables with quite a few fields and I'm getting errors when trying to insert records with single quotes in the data like: name = John O'Henry or a city name of O'Fallen So I went ahead and added a replace to replace the ' with " but now other fields are having the same problem and there are multiple fields involved. This data gets into having a lot of symbols used, etc. So rather than go through and replace these quotes...
24
22613
by: deko | last post by:
I'm trying to log error messages and sometimes (no telling when or where) the message contains a string with double quotes. Is there a way get the query to insert the string with the double quotes? Do I need to use code to scrub each string and remove or escape the double quotes before using it in a query? The error I get is this: Error Number 3075: Syntax error (missing operator) in query expression '"credit card billed by...
7
1505
by: Mark Knochen | last post by:
Hello, i have a php-script with a mysql_query ... $insert = mysql_query("INSERT INTO $table (textID,redaktion) VALUES ('$_POST','$row_startseiten')"); I get no mysql_error, if i copy the insert directly into phpmyadmin, the insert works. but with the php-script the insert doesn`t create a new row in the table .. but why?
4
6244
by: Evyn | last post by:
Hi all, I'm starting to fool around with STL and in particular std::map. How do I iterate through one map and insert every pair in another map? I have the following so far: map<double, doublefset1; map<double, doublefset3;
2
2801
by: jonceramic | last post by:
Hi, Question... Is there any way to put a wrapper on a raw string going through SQL, or should I bite the bullet and use a recordset method instead? Situation: I'm trying to have the user add comment data to a table. I calculate and/or determine all of the variables except for that comment.
5
2731
by: Rob | last post by:
I'm trying to use the set<my_class>::insert( my_class const & ) method, but have run into some problems. It seems like I'm seeing it insert an object when a similar object is already in the set. After calling insert(), I see the .second of the return value set to "true", meaning it was inserted. The size() of the set increases by 1, but the count() of the object I insert doesn't change (it was 1, it is still 1). I do a quick check and...
4
3123
by: Bob | last post by:
Hi all, I'm trying to import data, modify the data then insert it into a new table. The code below works fine for it but it takes a really long time for 15,000 odd records. Is there a way I can speed up the processing substantially? as it currently takes about 10 minutes and thats just way too long because there is many of these imports that I need to do.... I currently insert each record one by one and I imagine thats where all the...
0
8403
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8316
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8737
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8509
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7345
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6174
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4327
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1730
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.