2008-12-11 113 views

回答

2

從將WebMethod裏面寫下面的代碼(Web服務方法)

你可以使用一個for循環遍歷所有的按鍵值對在標題中重複

int Count = HttpContext.Current.Request.Headers.Count; 
for (int i = 0; i < Count; i++) 
{ 
    string key = HttpContext.Current.Request.Headers.GetKey(i); 
    string keyValue = HttpContext.Current.Request.Headers.Get(i); 
    //Do something 
}