// GET: SportAgency/LoadSports public ActionResult uploadSports() { try { if (ModelState.IsValid) { string filepath = ConfigurationManager.AppSettings["Path"].ToString(); //string relativePath = ConfigurationManager.AppSettings["Path"]; //Path.Combine(AppDomain.CurrentDomain.BaseDirectory, relativePath) if (filepath != null) { FileLoad fl = new FileLoad(); if (fl.insertsport(filepath) == 1) { ViewBag.Message = "Sports Inserted"; } else { ViewBag.Message = "Insertion failed"; } } } } catch (Exception e) { Debug.WriteLine("Error: {0}", e.ToString()); // ViewBag.Message = e.ToString(); } return(RedirectToAction("Load")); }
/// <summary> /// 加载文件1 /// </summary> /// <param name="fileDirectory">文件所在目录</param> /// <param name="fileName">文件名称</param> /// <param name="input"></param> private void LoadFile(string fileDirectory, string fileName, string input) { FileLoad fileLoad = new FileLoad(); do { Console.WriteLine("请输入你要操作的文件目录:"); fileDirectory = Console.ReadLine(); if (fileDirectory.Length > 0) { if (Directory.Exists(fileDirectory)) { Console.WriteLine("请输入你亚奥操作的文件名称"); fileName = Console.ReadLine(); if (fileName.Length > 0) { bool result = fileLoad.CheckInput(Path.Combine(fileDirectory, fileName)); fileLoad.CheckResult(result, input); if (fileLoad.IsOpertaion) { continue; } else { break; } } else { } } } } while (input != "退出"); }
// GET: SportAgency//Show public ActionResult Show() { FileLoad fl = new FileLoad(); ModelState.Clear(); return(View(fl.GetAthleteAndAgent())); }
private void Window_Load(object sender, EventArgs e) { foreach (TabItem tab in UIUtils.FindLogicalChildren <TabItem>(ui.tabMode)) { ICNCView view = getView(tab); view.Setup(UIViewModel, UIViewModel.Profile); tab.IsEnabled = view.ViewType == ViewType.GRBL || view.ViewType == ViewType.AppConfig; } if (!UIViewModel.Profile.Config.GCodeViewer.IsEnabled) { ShowView(false, ViewType.GCodeViewer); } xx.ItemsSource = UIViewModel.SidebarItems; UIViewModel.SidebarItems.Add(new SidebarItem("Jog", jogControl)); UIViewModel.SidebarItems.Add(new SidebarItem("Macros", macroControl)); UIViewModel.SidebarItems.Add(new SidebarItem("Goto", gotoControl)); UIViewModel.CurrentView = getView((TabItem)tabMode.Items[tabMode.SelectedIndex = 0]); System.Threading.Thread.Sleep(50); Comms.com.PurgeQueue(); UIViewModel.CurrentView.Activate(true, ViewType.Startup); if (!string.IsNullOrEmpty(UIViewModel.Profile.FileName)) { FileLoad?.Invoke(UIViewModel.Profile.FileName); } }
void OnTriggerEnter(Collider collider) { toggle.ButtonTurnsOn(); effect.gameObject.GetComponent <ParticleRenderer> ().enabled = true; str = enhance.GetComponent <EnhancelScrollView> ().centerItem.name.ToString(); //Debug.Log ("asdfasdfasvafcd"); FileLoad.getFileLoadInstance().setEnhance(str); }
/// <summary> /// Удаление файла платежки из БД /// </summary> /// <returns></returns> protected async Task RemoveOrderAsync() { //Проверяем модель а наличие записи о файле платежки и удаляем ее if (payment.IdOrder != 0) { await FileLoad.RemoveAsync(payment.IdOrder); payment.IdOrder = 0; } }
// —————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— void Awake() { Debug.Log("___________script2_________Awake"); gameobjectname = FileLoad.getFileLoadInstance().getEnhance(); //获取文件名 Debug.Log("gameobjectname =" + gameobjectname); GameObject pre = (GameObject)Resources.Load(gameobjectname); //加载物体 cube = (GameObject)Instantiate(pre, reset_position, reset_rotation); //实例化物体 }
/// <summary> /// Удалить запись /// </summary> /// <param name="item"></param> protected async Task RemoveAsync(Payment item) { //Удаляем платеж и вносим изменения в БД await Repository.RemoveAsync(item.IdPayment); await FileLoad.RemoveAsync(item.IdOrder); Invoice.Pay = false; await InvoiceRepository.EditAsync(Invoice); await StateUpdate(); }
/// <summary> /// Скачать файл платежки из БД /// </summary> /// <param name="item"></param> protected async void DownloadFile(Payment item) { //Проверяем есть ли в БД файл платежки Order order = await FileLoad.GetOrderById(item.IdOrder); if (order != null) { //Получаем из БД файл в виде массива байтов и имя файла var content = order.OrderScreen; var filename = order.FileName; //Сохраняем файл на диск await JSRuntime.InvokeAsync <object>( "FileSaveAs", filename, Convert.ToBase64String(content) ); } }
public ActionResult uploadathleteandagent(FormCollection collection) { try { if (ModelState.IsValid) { string filepath = collection["textFileDirectory"]; if (filepath != null && !filepath.Trim().Equals("")) { filepath = filepath.Trim(); FileLoad fl = new FileLoad(); string agentfilepath = filepath + "\\Agents.txt"; string athletefilepath = filepath + "\\Athletes.txt"; if (fl.insertagent(agentfilepath) == 1) { ViewBag.Message = "Agent inserted"; } else { ViewBag.Message = "Insertion failed"; } if (fl.insertathlete(athletefilepath) == 1) { ViewBag.Message = "Athelete inserted"; } else { ViewBag.Message = "Insertion failed"; } } } } catch (Exception e) { Debug.WriteLine("Error: {0}", e.ToString()); ViewBag.Message = e.ToString(); } return(RedirectToAction("Load"));; }
bool ButtonHasBeenClicked() { if (!Input.GetMouseButtonUp(TheManager.TM.LEFT_MOUSE)) { return(true); } if (ButtonBool.AnyButtonClicked) { if (menuButtons.place.ButtonIsClicked) { if (dcf.spawnThingy != null && dcf.mLoc.mouseHit) { BaseCommand create = new BaseCommand(); Thingy thing = PoolQueue.PQ.RequestThing(dcf.spawnThingy.tot); create.AddAction(new CSpawn(thing)); create.AddAction(new CMovement(thing, dcf.mLoc.gizmoPseudoPos)); create.Do(); return(false); } } if (menuButtons.load.ButtonIsClicked) { FileLoad fs = new FileLoad("SaveFile"); fs.Load(); return(false); } if (menuButtons.save.ButtonIsClicked) { FileSave fs = new FileSave("SaveFile"); fs.Save(); return(false); } return(false); } return(true); }
public void ForceLoad() { FileLoad fl = new FileLoad("LoadFile"); fl.Load(); }
private void Pipe_FileTransfer(string filename) { FileLoad?.Invoke(filename); }
/// <summary> /// 虚拟机代码执行器构造函数 /// </summary> /// <param name="application">上层应用界面</param> /// <param name="path">系统启动程序</param> /// <param name="memory">内存接口</param> /// <param name="core_num">虚拟机核心数</param> /// <param name="icomplex">复杂执行单元接口</param> /// <param name="time">时间操作接口</param> /// <param name="cache_size">缓存区大小</param> /// <param name="min_mem_size">进程内存分配最小量</param> /// <param name="idevice">IO设备接口</param> /// <param name="inet">网络接口</param> /// <param name="stack_size">进程堆栈数</param> public CodeExecutorUnit(IApplication application, string path, MemoryBase memory, int min_mem_size, IComplexOperation icomplex, TimeBase time, IDevice idevice = null, INetControl inet = null, int cache_size = 3, int core_num = 1, int stack_size = 100) { Application = application; App_Lock = 0; StackSize = stack_size; AddNewProgramFlag = true; FreeFileIDTable = new SortedList <int, int> { { 0, ushort.MaxValue } }; FreeProgramIDTable = new SortedList <int, int> { { 0, ushort.MaxValue } }; FileLoad = new FileLoad(min_mem_size, this); FileLoad_Lock = 0; IDevice = idevice; Device_Lock = 0; INet = inet; Net_Lock = 0; Memory = memory; Memory_Lock = 0; Time = time; Time_Lock = 0; FileTable = new Dictionary <int, FileStream>(); File_Lock = 0; Ring = new ProcessRing(); Ring_Lock = 0; IComplex = icomplex; Cores = new ProcessCodeExecutorUnit[core_num > 0 ? core_num : 0]; for (int i = 0; i < Cores.Length; i++) { Cores[i] = new ProcessCodeExecutorUnit(i, this, icomplex, cache_size); } if (null != path) { BackGroundCore = new CoreCodeExecutorUnit(this, icomplex, cache_size); ProgramUnit program = FileLoad.Complete(path); if (null != program) { program.MemorySpace = Memory.ApplyMemory(program.MemorySize, out long realize); if (-1 != realize) { int id = GetProgramID(); if (-1 != id) { BackGroundCore.Start(new Process(id, program, stack_size) { Running = false, Time = new TimeSpan(0, 0, 0, 0, 0) }); } } else { Application.Print("虚拟机错误 内存溢出 停止创建进程"); } } } }