简体   繁体   中英

c# StreamReader ReadLine() Keep Quotes

I have the following, and need to get the first line from the socket, but not have c# remove the quotes. I can't escape the quotes in the input as they come from a source I don't control.

StreamReader sr = new StreamReader(socketStream);
string firstLine = sr.ReadLine();

Example Input Line: GET "/aaaadoe"

firstLine equals GET /aaaadoe and not GET "/aaaadoe".

Any suggestions?

StreamReader does not remove quotes. Some ideas:

  1. The quotes were not sent
  2. Something else removed them
  3. You are not looking at the right string, or misinterpreting the debugger display of it

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM