문제

Lets say I have

WebClient client = new WebClient();
client.Headers.Set("MyFlag", "12356"); 

How can read "MyFlag" later?

도움이 되었습니까?

해결책

Well, Headers is read/write, so you can write:

string value = client.Headers["MyFlag"];

By the way, you can also use this to set the header:

client.Headers["MyFlag"] = "123456";

See WebHeaderCollection documentation.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top