public Form1() { InitializeComponent(); domainLeft = ConnectionUtils.GetInstance().UserDetailsFromGeoApi(); InitLeftValues(domainLeft); ofd = new OpenFileDialog(); ofd.Filter = "CSV files (*.csv) | *.csv;"; }
private void bCheckR_Click(object sender, EventArgs e) { domainRight = ConnectionUtils.GetInstance().HostDetailsFromGeoApi(tbIPR.Text); InitRightValues(domainRight); }
private void bCheckL_Click(object sender, EventArgs e) { domainLeft = ConnectionUtils.GetInstance().HostDetailsFromGeoApi(tbIPL.Text); InitLeftValues(domainLeft); }
private void InitRightValues(GeoApiResponse geoApiResponse) { if (geoApiResponse != null) { tbStatusR.Text = geoApiResponse.status; tbCountryR.Text = geoApiResponse.country; tbRegionNameR.Text = geoApiResponse.regionName; tbCityR.Text = geoApiResponse.regionName; tbZipCodeR.Text = geoApiResponse.zip; textBox7.Text = "" + geoApiResponse.lat; tbLonR.Text = "" + geoApiResponse.lon; tbTimezoneR.Text = geoApiResponse.timezone; tbIspNameR.Text = geoApiResponse.isp; tbOrganizationNameR.Text = geoApiResponse.org; tbAsNumberR.Text = geoApiResponse.@as; FillDistanceBetweenDomains(); FillRTTAndHopCountRight(domainRight); } }
private void InitLeftValues(GeoApiResponse geoApiResponse) { if (geoApiResponse != null) { tbStatusL.Text = geoApiResponse.status; tbCountryL.Text = geoApiResponse.country; tbRegionNameL.Text = geoApiResponse.regionName; tbCityL.Text = geoApiResponse.regionName; tbZipCodeL.Text = geoApiResponse.zip; tbLatL.Text = "" + geoApiResponse.lat; tbLonL.Text = "" + geoApiResponse.lon; tbTimezoneL.Text = geoApiResponse.timezone; tbIspNameL.Text = geoApiResponse.isp; tbOrganizationNameL.Text = geoApiResponse.org; tbAsNumberL.Text = geoApiResponse.@as; FillDistanceBetweenDomains(); FillRTTAndHopCountLeft(domainLeft); } }
private void FillRTTAndHopCountRight(GeoApiResponse geoApiResponse) { if (geoApiResponse.status.Equals(SUCCESS)) { tbRTTR.Text = ConnectionUtils.GetInstance().PingHost(IPAddress.Parse(geoApiResponse.query)).RoundtripTime + ""; tbDistanceIPR.Text = ConnectionUtils.GetInstance().PerformPathping(IPAddress.Parse(geoApiResponse.query)).Length + ""; } }