Ejemplo n.º 1
0
    void Start()
    {
        string externalip = new System.Net.WebClient().DownloadString("http://ipinfo.io/ip").Trim();

        Debug.Log(externalip);
        ipAd = externalip.ToString();
    }
Ejemplo n.º 2
0
 public MainForm()
 {
     if (pingURL("http://yesit.com.au") == true)
     {
         string json = new WebClient().DownloadString("http://yesit.com.au/bvsc.php");
         if (json.ToString() != "1")
         {
             DialogResult result = MessageBox.Show("You are no longer authorized to run this diag.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
             if (result == DialogResult.OK)
             {
                 Environment.Exit(0);
             }
         }
     }
     InitializeComponent();
 }
Ejemplo n.º 3
0
 private static void GetLatLongByLocation(string destination, ref string lat, ref string lng)
 {
     try
     {
         var address = String.Format("http://maps.google.com/maps/api/geocode/json?address={0}&sensor=true&components=country:{1}", destination.Replace(" ", "+"), "India");
         var result  = new System.Net.WebClient().DownloadString(address);
         var jo      = JObject.Parse(result);
         result = jo["results"].ToString();
         var ja = JArray.Parse(result);
         jo     = JObject.Parse(ja[0].ToString());
         result = jo["geometry"]["location"].ToString();
         var latObj = JObject.Parse(result.ToString());
         lat = latObj["lat"].ToString();
         lng = latObj["lng"].ToString();
     }
     catch
     { }
 }
Ejemplo n.º 4
0
        public ActionResult next(string n)
        {
            var json = new WebClient().DownloadString("https://gist.githubusercontent.com/WillemLabu/34cfb50187ec334c48ee/raw/cb46400505afd82d9e354b591ad71d97f07613be/jobs.json");
                Trace.TraceError(json.ToString());
                var objects = JObject.Parse(json.ToString()); // parse as array
                var subject = JArray.Parse(objects.GetValue("jobs").ToString());
                List<Jobs> jobs = new List<Jobs>();

                foreach (var root in subject)
                {

                    var data = JObject.Parse(root.ToString());
                    Jobs job = new Jobs();
                    job.client = data.GetValue("client").ToString();
                    job.jobNumber = data.GetValue("job-number").ToString();
                    job.jobName = data.GetValue("job-name").ToString();
                    job.due = data.GetValue("due").ToString();
                    job.status = data.GetValue("status").ToString();

                    jobs.Add(job);

                }

                if (Int32.Parse(n) >= jobs.Count() || Int32.Parse(n) < 0)
                {
                ViewBag.Last = 0;
                return View("Index",jobs.GetRange(0, 10));
            }

                ViewBag.Last = Int32.Parse(n);
            return View("Index",jobs.GetRange(Int32.Parse(n), 10));
        }
Ejemplo n.º 5
0
        // GET: Jobs
        public ActionResult Index(String SearchString)
        {
            var json = new WebClient().DownloadString("https://gist.githubusercontent.com/WillemLabu/34cfb50187ec334c48ee/raw/cb46400505afd82d9e354b591ad71d97f07613be/jobs.json");
            Trace.TraceError(json.ToString());
            var objects = JObject.Parse(json.ToString()); // parse as array
            var subject = JArray.Parse(objects.GetValue("jobs").ToString());
            List<Jobs> jobs = new List<Jobs>();

            foreach (var root in subject)
            {

                var data = JObject.Parse(root.ToString());
                Jobs job = new Jobs();
                job.client = data.GetValue("client").ToString();
                job.jobNumber = data.GetValue("job-number").ToString();
                job.jobName = data.GetValue("job-name").ToString();
                job.due = data.GetValue("due").ToString();
                job.status = data.GetValue("status").ToString();

                jobs.Add(job);

            }

            var joblist = from m in jobs
                          select m;
            if (!String.IsNullOrEmpty(SearchString))
            {
                jobs = jobs.Where(b => b.jobName.ToUpper().Contains(SearchString.ToUpper())).ToList();

                return View(jobs);

            }
            ViewBag.Last = 0;
            list = jobs;
            return View(jobs.GetRange(0,10));
        }