0

Visual Studio 2012를 사용 중이며 Windows Phone 7.1 응용 프로그램 개발을하고 있습니다. 이것은 새로 생성 된 프로젝트입니다.WebRequestMethods가 현재 컨텍스트에 존재하지 않는 이유는 무엇입니까?

이 코드를 사용할 때 왜이 오류가 발생합니까?

The name 'WebRequestMethods' does not exist in the current context 

코드 :이 WebRequestMethods이 System.Net의 일부임을 인식 할 수처럼

using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Net; 
using System.Windows; 
using System.Windows.Controls; 
using System.Windows.Documents; 
using System.Windows.Input; 
using System.Windows.Media; 
using System.Windows.Media.Animation; 
using System.Windows.Shapes; 
using Microsoft.Phone.Controls; 

... 

public MainPage() { 
    HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://www.google.com"); 
    request.Method = WebRequestMethods.Http.Post; 
} 

... 

보인다. 또한 System.Net.WebRequestMethods.Http.Post를 지정하면 실패합니다.

답변

2

System.Net.WebRequestMethods.Http은 Windows Phone 용 .NET 프로필에서는 사용할 수 없지만보고있는 문서 페이지에 따라 쉽게 이해할 수는 없습니다. 문자열 값 "POST"로 설정하십시오.

는 내 블로그의 글에서 몇 가지 추가 컨텍스트가 : Windows Runtime-What's supported Where?

+0

나는 이런 식으로 뭔가를 의심하지만 난 단지에 대한 정보를 찾을 수 없습니다. 감사! –

관련 문제