0
입니다. http get 요청을 사용하여 서버에 위치 데이터를 보내는 간단한 앱을 만들고 있습니다. 문제는 positionchanged 이벤트 처리기 안에 있다는 사실에도 불구하고 요청이 처음으로 만들어진 것입니다.도착 위치는 get
여기 내 코드입니다. 나는 그것이 무엇이 잘못되었는지를 알 수 없다.
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;
using System.Device.Location;
namespace kechap
{
public partial class MainPage : PhoneApplicationPage
{
GeoCoordinateWatcher gw = new GeoCoordinateWatcher();
Uri url = new Uri("http://127.0.0.1:5000/upload/1e3fae069dd62fa1641183cd77092ed2053a0e75/1/2");
// Constructor
public MainPage()
{
InitializeComponent();
gw.MovementThreshold = 10;
gw.PositionChanged += (s, e) =>
{
MyMap.Center = e.Position.Location;
MyPushpin.Location = e.Position.Location;
WebClient wc = new WebClient();
wc.OpenReadAsync(url);
wc.OpenReadCompleted += (ss, ee) =>
{
};
};
gw.Start();
}
}
}
그건 내가 예측하지 못한 것입니다. 나는 그것이 작동하는지 테스트 할 URL을 고정 시켰고 이것은 나를 실패시켰다. – kechapito
웹 응용 프로그램 초기에 캐시는 내 존재의 단점이었습니다. HTML 메타 태그와 지시어에 URL (이미 제안한대로)을 흐리게 처리하는 것에서부터 금지하는 것에 이르기까지 여러 가지 방법이 있습니다. URL을 짧게 표시하는 것은 추악하지만 신뢰할 만합니다. 아래쪽은 브라우저 캐시를 압축합니다. –