Home > Net >  C # download url value out of the text box task is always wrong, direct assignment is normal. Please
C # download url value out of the text box task is always wrong, direct assignment is normal. Please

Time:09-15

[align=left]
String s=@ "http://www.shuquge.com/txt/8400/index.html";
WebRequest request=WebRequest. Create (Url);
The runtime is normal,

Textbox1. Text=@ "http://www.shuquge.com/txt/8400/index.html";//content is copied into the text box of
String s=textbox1. Text. The trim ();
WebRequest request=WebRequest. Create (Url);
Runtime error,

Please people,

[/align]

CodePudding user response:

WebRequest. Create ( );

No place to see this Url, you come from

CodePudding user response:

The
refer to the original poster hbymzlx001 response:

[align=left]String s=@ "http://www.shuquge.com/txt/8400/index.html";
WebRequest request=WebRequest. Create (Url);
The runtime is normal,

Textbox1. Text=@ "http://www.shuquge.com/txt/8400/index.html";//content is copied into the text box of
String s=textbox1. Text. The trim ();
WebRequest request=WebRequest. Create (Url);
Runtime error,

Please people,

[/align]

Meaning from the text box is error values, the same text download is normal assignment directly, how to make the text box to take out the URL value and normal operation of the same direct assignment?

CodePudding user response:

reference 1st floor wanghui0380 response:
WebRequest. Create ( );

There's no place to see this Url from where come of

This is a network request, not write

CodePudding user response:

reference 1st floor wanghui0380 response:
WebRequest. Create ( );

There's no place to see this Url from where come of

URL generation to S

CodePudding user response:

My side, no problem,
The breakpoint has been completed,
Is your native language? Cs file encoding format? And so on the reason?

  •  Tags:  
  • C#
  • Related