public ActionResult Save(string ip, int port, int TimesPerSecond, int timeout, string path) { Session["timeout"] = timeout; Session["path"] = path; connect.Open(ip, port); connect.ConnetAsClient(); Double LON = connect.LON; Double LAT = connect.LAT; string throttle = connect.throttleString; string rudder = connect.rudderString; this.ViewBag.LON = LON; this.ViewBag.LAT = LAT; this.ViewBag.throttleString = connect.throttleString; this.ViewBag.rudderString = connect.rudderString; Session["TimesPerSecond"] = TimesPerSecond; this.ViewBag.TimesPerSecond = TimesPerSecond; string fileName = path; // get a file path to save the file in string filePath = AppDomain.CurrentDomain.BaseDirectory + @"\" + fileName + ".txt"; path1 = filePath; // save the values using (StreamWriter streamWriter = System.IO.File.AppendText(filePath)) { streamWriter.WriteLine(connect.LONstring + ',' + connect.LATstring + ',' + throttle + ',' + rudder); } return(View()); }
public ActionResult Display(string ip, int port) { connect.Open(ip, port); connect.ConnetAsClient(); Double LON = connect.LON; Double LAT = connect.LAT; this.ViewBag.LON = LON; this.ViewBag.LAT = LAT; return(View("Display")); }
public ActionResult displayTimesPerSecond(string ip, int port, int TimesPerSecond) { connect.Open(ip, port); connect.ConnetAsClient(); Double LON = connect.LON; Double LAT = connect.LAT; this.ViewBag.LON = LON; this.ViewBag.LAT = LAT; Session["TimesPerSecond"] = TimesPerSecond; this.ViewBag.TimesPerSecond = TimesPerSecond; return(View()); }