public async Task <IActionResult> PutComputerID([FromRoute] Guid id, [FromBody] ComputerID computerID) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != computerID.ID) { return(BadRequest()); } _context.Entry(computerID).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ComputerIDExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public string GetString() { return(ComputerID.ToString() + "," + CpuID.ToString() + "," + RamID.ToString() + "," + HardDriveID.ToString() + "," + DisplayID.ToString() + "," + OsID.ToString()); }
public async Task <IActionResult> PostComputerID([FromBody] ComputerID computerID) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.ComputerIDs.Add(computerID); await _context.SaveChangesAsync(); return(CreatedAtAction("GetComputerID", new { id = computerID.ID }, computerID)); }
static void Main(string[] a_Args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); string paranoidString = "If_you_feel_paranoid_Read=http://www.h**o-programmatis.com/EveRefinery/userid.html"; Updater updater = new Updater(); string updateXmlUrl = "http://www.h**o-programmatis.com/EveRefinery/updates.php?" + paranoidString + "&userid=" + ComputerID.GetComputerID(); string updatedApp = "EveRefinery"; bool isSilent = a_Args.Contains("/silent"); bool showForm = true; try { updater.LoadFileList(updateXmlUrl); updater.MakeDecisions(); } catch (System.Exception a_Exception) { if (!isSilent) { string errorHeader = "Update failed.\nIf it's not clear how to fix the error, please try again later.\n\nThe reported error is:\n"; ErrorMessageBox.Show(errorHeader + a_Exception.Message); } showForm = false; } if (isSilent && showForm) { showForm = updater.IsUpdateNeeded(); } if (showForm) { Application.Run(new FrmMain(updater, updateXmlUrl, updatedApp)); } }