프로그래밍 방식으로 sharepoint 앱에 로그인하여 해당 웹 사이트 내에서 특정 페이지의 html 코드를 가져 오려고합니다. 프로그래밍 방식으로 어떻게 할 수 있습니까? 로그인 매개 변수를 전달하고 html 코드를 가져 오는 데 필요한 URL에 액세스해야하는 부분에 문제가 있습니다. 사전 모두에 감사합니다,프로그래밍 방식으로 C#을 통해 sharepoint에 로그인
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create("http://mysite.sharepoint.com");
NetworkCredential credentials = new NetworkCredential("myUser", "myPass");
request.Credentials = credentials;
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream receiveStream = response.GetResponseStream();
StreamReader readStream = new StreamReader (receiveStream, Encoding.UTF8);
string html = readStream.ReadToEnd();
response.Close();
readStream.Close();
이 질문에 이동되어야한다 [sharepoint.stackexchange.com] (http://sharepoint.stackexchange.com/) – pstrjds
@pstrjds - 이것은 일반적인 프로그래밍 질문 (sharepoint에 대한 참조에도 불구하고)처럼 보이지만 여기서 남겨 둘 것을 제안합니다. – Peter
@Patricker - 지금 내 커피를 마셨다. 나는 동의한다. – pstrjds