Exemplo n.º 1
0
 /// <summary>
 /// 
 /// </summary>
 public void GetState()
 {
     UriBuilder fullUri = new UriBuilder(GET_CURRENT_STATE);
     HttpWebRequest Request = (HttpWebRequest)WebRequest.Create(fullUri.Uri);
     RequestUpdateState forecastState = new RequestUpdateState();
     forecastState.AsyncRequest = Request;
     Request.BeginGetResponse(new AsyncCallback(HandleStateResponse), forecastState);
 }
Exemplo n.º 2
0
        public void SendInfo(MainViewModel model)
        {
            UriBuilder fullUri = new UriBuilder(SEND_INFO);
            HttpWebRequest Request = (HttpWebRequest)WebRequest.Create(fullUri.Uri);
            Request.ContentType = "application/x-www-form-urlencoded";
            Request.Method = "POST";
            Request.UserAgent = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.79 Safari/537.4";
            RequestUpdateState forecastState = new RequestUpdateState();
            forecastState.UpdateMode = 0;
            forecastState.AsyncRequest = Request;
            forecastState.Data = "direction=0&point=0&number=1&lenght=&comment=Пусто&author=trackmonster";
            Request.BeginGetRequestStream(RequestReady, forecastState);

            Request.BeginGetResponse(new AsyncCallback(HandleSendResponce), forecastState);
        }
Exemplo n.º 3
0
 public void GetJournal(int offset)
 {
     UriBuilder fullUri = new UriBuilder(GET_NEXT_JOURNAL_ITEMS + offset);
     HttpWebRequest Request = (HttpWebRequest)WebRequest.Create(fullUri.Uri);
     RequestUpdateState forecastState = new RequestUpdateState();
     forecastState.UpdateMode = 1;
     forecastState.AsyncRequest = Request;
     Request.BeginGetResponse(new AsyncCallback(HandleResponse), forecastState);
 }