21. August 2013 16:49
21. August 2013 17:34
25. August 2013 13:35
static void Main(string[] args)
{
var svcUri = new Uri("http://Server:Port/DynamicsNAV70/ODATA/");
var WebRequ = WebRequest.Create(svcUri) as HttpWebRequest;
WebRequ.Accept = "application/json;odata=verbose";
var netwCredential = new NetworkCredential(User,pw);
var CredentCach = new CredentialCache();
CredentCach.Add(svcUri, "NTLM", netwCredential);
WebRequ.PreAuthenticate = true;
WebRequ.Credentials = CredentCach;
WebResponse WebRespon = WebRequ.GetResponse();
Stream streamWebResp = WebRespon.GetResponseStream();
StreamReader readerWebResp = new StreamReader(streamWebResp, Encoding.Default);
String Content = readerWebResp.ReadToEnd();
streamWebResp.Close();
WebRespon.Close();
Console.WriteLine(Content);
}