locked
Laucnh a sharepoint site from Win8 App RRS feed

Answers

  • Make sure the capability Private Networks(Client and Server) is server in Package.appmanifest file.

    Nazia

    • Marked as answer by LearntoLearn Monday, September 30, 2013 12:11 PM
    Monday, September 30, 2013 12:07 PM

All replies

  • http get method

                    var client = new HttpClient();
                    client.MaxResponseContentBufferSize = Int32.MaxValue; // Read up to Max of data
                    HttpResponseMessage response = await client.GetAsync(new Uri(URI));
                    if (response.StatusCode == HttpStatusCode.OK)
                    {
                        string json = await response.Content.ReadAsStringAsync();
                        dynamic arr = JsonParser.Parse(jsonstate);
                        var itemsreceived = arr[0].items;
                        if (itemsreceived.Length == 0 || itemsreceived == null)
                        {
                            MessageDialog md = new MessageDialog("No Values Are Assigned  ", "contact admin");
                            await md.ShowAsync();
                        }

    else

    {

    //do function

    }

    http post method

     try
                            {
                                string URI = URLA + "login.jsp";
                                StringBuilder body = new StringBuilder();
                                body.Append("userName=" + userName + "&");
                                body.Append("password=" + password);
                                var response = await HttpPost(URI, body.ToString());
                                if (response.StatusCode == HttpStatusCode.OK)
                                {

                               }

    }

     public static async Task<HttpResponseMessage> HttpPost(string uri, string body)
            {
                HttpClient client;
                CookieContainer cookies = new CookieContainer();
                HttpClientHandler handler = new HttpClientHandler();
                handler.CookieContainer = cookies;
                client = new HttpClient(handler);
                var content = new StringContent(body);
                client.DefaultRequestHeaders.ExpectContinue = false;
                content.Headers.ContentType = new MediaTypeHeaderValue("application/x-www-form-urlencoded");
                return await client.PostAsync(uri, content);
            }

    Wednesday, September 25, 2013 11:50 AM
  • I am not sure what this does...

    I simply want to open the url in browser like if I set

    bool res =  await Launcher.LaunchUriAsync(new Uri("http://www.google.com")); in the onclick event of a button, it opens that page in IE10 browser. So I am expecting the same for sharepoint url.

    Wednesday, September 25, 2013 11:59 AM
  • Make sure the capability Private Networks(Client and Server) is server in Package.appmanifest file.

    Nazia

    • Marked as answer by LearntoLearn Monday, September 30, 2013 12:11 PM
    Monday, September 30, 2013 12:07 PM