public static string GetClub() { try { string sysDir = AppDomain.CurrentDomain.BaseDirectory; string filepath = sysDir + "club.txt"; if (!File.Exists(filepath)) { frmSetClub clubform = new frmSetClub(); clubform.ShowDialog(); } else { if (File.Exists(filepath)) { string[] clublist = ReadText.ReadTextFile(filepath); return(clublist[0]); } else { return(""); } } return(""); } catch (Exception ex) { throw ex; } }
// Use this for initialization public void Start() { spaceUnderstanding = SpaceUnderstanding.Instance; // Start mapping room, hide mesh if (SpatialMappingManager.Instance == null) { Debug.Log("SpatialMappingManager is null"); } else { spatialMappingManager = SpatialMappingManager.Instance; } if (ReadText.Instance != null) { readText = ReadText.Instance; } holoLensimage = GameObject.Find("HoloLensImage"); #if UNITY_EDITOR spatialMappingManager.DrawVisualMeshes = true; #else spatialMappingManager.DrawVisualMeshes = false; spatialMappingManager.StartObserver(); #endif // Start to recognize gestures gestureRecognizer = new GestureRecognizer(); gestureRecognizer.SetRecognizableGestures(GestureSettings.Tap); gestureRecognizer.StartCapturingGestures(); SpatialUnderstanding.Instance.UnderstandingCustomMesh.DrawProcessedMesh = false; }
private void GetDetails() { string path = ReadText.ReadFilePath("datapath"); // string filepath = path + "\\ClubInfo.txt"; string birdDetailsPath = path + "\\PigeonDetails\\" + txtMemberID.Text + "\\" + txtrfid.Text + ".txt"; if (EntryList != "" && EntryList.Contains(txtrfid.Text)) { MessageBox.Show("Bird Already Entry.", "Information"); this.txtrfid.Text = ""; } else { if (File.Exists(birdDetailsPath)) { string[] pigeonDetailsCollection = ReadText.ReadTextFile(birdDetailsPath); txtRingNumber.Text = pigeonDetailsCollection[0]; txtSex.Text = pigeonDetailsCollection[3]; txtColor.Text = pigeonDetailsCollection[4]; txtCategory.Text = pigeonDetailsCollection[2]; LoadImage(txtrfid.Text, txtMemberID.Text); Save(); } else { MessageBox.Show("Bird not found!", "Error"); this.txtrfid.Text = ""; this.txtrfid.Focus(); } } }
void ReleaseDesignerOutlets() { if (ClearButton != null) { ClearButton.Dispose(); ClearButton = null; } if (ReadButton != null) { ReadButton.Dispose(); ReadButton = null; } if (ReadText != null) { ReadText.Dispose(); ReadText = null; } if (StatusLabel != null) { StatusLabel.Dispose(); StatusLabel = null; } if (StopButton != null) { StopButton.Dispose(); StopButton = null; } }
// Use this for initialization void Start() { try { string ss = ReadText.readTextFile(sText); GetDaTa(ss); string stVuotQua = DataManager.GetVuotQua(); if (stVuotQua.Equals("")) { } else { if (stVuotQua.Contains("+")) { string[] mang = stVuotQua.Split('+'); for (int i = 0; i < mang.Length; i++) { lstVuotQua.Add(mang [i]); } } else { lstVuotQua.Add(stVuotQua); } } } catch (System.Exception) { throw; } }
/// <summary> /// This is run when the application starts. /// This method is used to initalize all of its required variables once. /// The reason for this is because it uses the singleton design pattern as to not /// have to create many instances of this object. /// </summary> void Start() { assessmentPanel = GameObject.Find("AssessmentPanel"); infoPanel = GameObject.Find("InfoPanel"); correctPanel = GameObject.Find("CorrectPanel"); assessmentCollider = assessmentPanel.transform.GetComponent <BoxCollider>(); answerPanel = assessmentPanel.transform.FindChild("AnswerPanel").gameObject; ansA = answerPanel.transform.FindChild("AnswerA").gameObject; ansB = answerPanel.transform.FindChild("AnswerB").gameObject; ansC = answerPanel.transform.FindChild("AnswerC").gameObject; ansD = answerPanel.transform.FindChild("AnswerD").gameObject; ansE = answerPanel.transform.FindChild("AnswerE").gameObject; ansF = answerPanel.transform.FindChild("AnswerF").gameObject; txtToSpeach = GameObject.Find("TextToSpeech").GetComponent <ReadText>(); img = infoPanel.transform.FindChild("InfoContainer").FindChild("ObjectImage").GetComponent <Image>(); ansC.SetActive(false); ansD.SetActive(false); ansF.SetActive(false); ansE.SetActive(false); infoPanel.SetActive(false); assessmentPanel.SetActive(false); correctPanel.SetActive(false); xml.setup(); cam = GameObject.Find("HoloLensCamera").GetComponent <Camera>(); }
private void SyncEntryInDatabase() { try { string path = AppDomain.CurrentDomain.BaseDirectory + "SyncApplication"; string filepath = path + "\\resultinfo.txt"; string Actionfilepath = path + "\\action.txt"; string dateString = this.DateRelease.Year.ToString() + this.DateRelease.Month.ToString().PadLeft(2, '0') + this.DateRelease.Day.ToString().PadLeft(2, '0'); string[] args = { ClubName, dateString, ReadText.ReadFilePath("datapath"), this.DateRelease.ToShortDateString() }; string[] actionargs = { "ENTRYDB" }; System.IO.File.WriteAllLines(filepath, args); //pigeondetails System.IO.File.WriteAllLines(Actionfilepath, actionargs); //pigeondetails var process = Process.Start(path + "\\SyncEclock.exe"); process.WaitForExit(); var exitCode = process.ExitCode; this.Close(); } catch (Exception ex) { throw ex; } }
private void button4_Click(object sender, EventArgs e) { try { string memberID = this.txtMemberID.Text; string path = ReadText.ReadFilePath("datapath"); string filepath = path + "\\PigeonList\\" + memberID + ".txt"; string[] pigeonlist = GetPigeonForEntry(filepath); string[] entryCol = { }; if (pigeonlist.Count() > 0) { foreach (var item in pigeonlist) { string[] pigeonDetails = item.Split('|'); string[] entry = { pigeonDetails[2] }; entryCol = entryCol.Concat(entry).Distinct().ToArray(); } string dateString = this.dateTimePicker1.Value.Year.ToString() + this.dateTimePicker1.Value.Month.ToString().PadLeft(2, '0') + this.dateTimePicker1.Value.Day.ToString().PadLeft(2, '0'); string entryDirectory = path + "\\entry\\" + dateString; string entryfilepath = entryDirectory + "\\" + memberID + ".txt"; System.IO.File.WriteAllLines(entryfilepath, entryCol); //entrylist GetPigeonList(this.txtMemberID.Text); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error"); } }
public void Should_be_able_to_read_text_from_string() { var readFromString = new ReadText(); var read = readFromString.Read(); read.Length.Should().NotBe(null); }
private void ReadEntryLogs() { try { DataTable entrylistlogs = new DataTable(); DataColumn dc1 = new DataColumn(); dc1.ColumnName = "Retry"; DataColumn dc2 = new DataColumn(); dc2.ColumnName = "MemberIDNo"; DataColumn dc3 = new DataColumn(); dc3.ColumnName = "TagID"; DataColumn dc4 = new DataColumn(); dc4.ColumnName = "Ring"; DataColumn dc5 = new DataColumn(); dc5.ColumnName = "Remarks"; entrylistlogs.Columns.Add(dc1); entrylistlogs.Columns.Add(dc2); entrylistlogs.Columns.Add(dc3); entrylistlogs.Columns.Add(dc4); entrylistlogs.Columns.Add(dc5); //string path = ReadText.ReadFilePath("datapath"); //string dateString = this.DateRelease.Year.ToString() + this.DateRelease.Month.ToString().PadLeft(2, '0') + this.DateRelease.Day.ToString().PadLeft(2, '0'); string pathSyncApplication = AppDomain.CurrentDomain.BaseDirectory + "SyncApplication"; string filepath = pathSyncApplication + "\\entrylogs.txt"; if (File.Exists(filepath)) { string[] pigeonCollection = ReadText.ReadTextFile(filepath); foreach (string item in pigeonCollection) { string[] value = item.Split('|'); DataRow dr = entrylistlogs.NewRow(); dr["RETRY"] = "RETRY"; dr["MemberIDNo"] = value[0].ToString(); dr["TagID"] = value[1].ToString(); dr["Ring"] = value[2].ToString(); dr["Remarks"] = value[3].ToString(); entrylistlogs.Rows.Add(dr); } } dtList.DataSource = entrylistlogs; //lblcount.Text = "Total Birds: " + entrylistlogs.Rows.Count.ToString(); } catch (Exception ex) { throw ex; } }
public static void CreateStorageFolder() { try { string path = ReadText.ReadFilePath("datapath"); string images = path + @"\Images"; if (!Directory.Exists(images)) { Directory.CreateDirectory(images); } string members = path + @"\Members"; if (!Directory.Exists(members)) { Directory.CreateDirectory(members); } string pigeonDetails = path + @"\PigeonDetails"; if (!Directory.Exists(pigeonDetails)) { Directory.CreateDirectory(pigeonDetails); } string pigeonList = path + @"\PigeonList"; if (!Directory.Exists(pigeonList)) { Directory.CreateDirectory(pigeonList); } string pigeonMobileNumberList = path + @"\PigeonMobileList"; if (!Directory.Exists(pigeonMobileNumberList)) { Directory.CreateDirectory(pigeonMobileNumberList); } string entryList = path + @"\Entry"; if (!Directory.Exists(entryList)) { Directory.CreateDirectory(entryList); } string resultList = path + @"\Result"; if (!Directory.Exists(resultList)) { Directory.CreateDirectory(resultList); } string pigeonLogs = path + @"\Logs"; if (!Directory.Exists(pigeonLogs)) { Directory.CreateDirectory(pigeonLogs); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error"); } }
private Boolean SavetoFile(string MemberIDNo, string MemberName, Int64 PigeonID, string BandNumber, string Sex, string Color, PictureBox Photo1, PictureBox Photo2, string RFID, String category, string TestRing) { try { string path = ReadText.ReadFilePath("datapath"); string detailspath = path + "\\pigeondetails\\" + MemberIDNo + "\\" + RFID + ".txt"; string memberpath = path + "\\members\\" + MemberIDNo + ".txt"; string pigeonlistpath = path + "\\pigeonlist\\" + MemberIDNo + ".txt"; if (ActionType != "EDIT" && File.Exists(detailspath)) { MessageBox.Show("Tag already assign to other bird.", "Error"); return(false); } string[] memberDetails = { MemberIDNo, MemberName, TestRing }; string[] pigeonDetails = { BandNumber, RFID, category, Sex, Color }; string[] pigeonList = SetPigeonList(ActionType, PigeonID.ToString(), BandNumber, Sex, Color, RFID, category).ToArray(); System.IO.File.WriteAllLines(memberpath, memberDetails); //memberdetails System.IO.File.WriteAllLines(pigeonlistpath, pigeonList); //memberpigeonlist string pigeondetailsDirectory = path + "\\pigeondetails\\" + MemberIDNo; if (!Directory.Exists(pigeondetailsDirectory)) { Directory.CreateDirectory(pigeondetailsDirectory); } System.IO.File.WriteAllLines(detailspath, pigeonDetails); //pigeondetails string pigeonimageDirectory = path + "\\images\\" + MemberIDNo; if (!Directory.Exists(pigeonimageDirectory)) { Directory.CreateDirectory(pigeonimageDirectory); } if (Photo1.Image != null) { string filename = pigeonimageDirectory + "\\" + RFID + ".txt"; File.WriteAllBytes(filename, GetPhoto(imgCapture)); } if (Photo2.Image != null) { string filename = pigeonimageDirectory + "\\" + RFID + "_P2" + ".txt"; File.WriteAllBytes(filename, GetPhoto(pictureBox1)); } return(true); } catch (Exception) { throw; } }
public static void PrintAllText() { IReadText readText = new ReadText(); IWriteText writeText = new TextToStringWriter(); var text = readText.Read().Manipulate(GetManipulatorRules()); Console.Write(writeText.Write(text)); Console.ReadKey(); }
static void Main(string[] args) { Console.WriteLine("Introduceti adresa textului: "); string Path = Console.ReadLine(); ReadText.ReadAllText(Path); Console.ReadKey(); }
// Use this for initialization void Start() { string ss = ReadText.readTextFile(sText); GetDaTa(ss); maxlevel = DataManager.GetHightScoreALTP(); AlSoundController.Instance.PlayBatDau(); btnPower.OnClick += btnPower_OnClick; }
private int controlPointNumber; // the control point which the spline is moving towards // (starts with 1 (0 is the starting point)) // Start is used in unity in place of the usual constructor public Spline(ReadText readText, int splineNumber) { //frameCounter = 0; controlPointNumber = 1; yCoord = 0.2f; this.readText = readText; this.splineNumber = splineNumber; }
private void grid_DoubleClick(object sender, EventArgs e) { try { DataGridView datagrid = this.dtList; int index; //Int64 PigeonID; String BandNumber = ""; String RFID = ""; if (datagrid.RowCount > 0) { index = datagrid.CurrentRow.Index; //PigeonID = Convert.ToInt64(datagrid.Rows[Convert.ToInt32(index)].Cells[2].Value); BandNumber = Convert.ToString(datagrid.Rows[Convert.ToInt32(index)].Cells[2].Value); RFID = Convert.ToString(datagrid.Rows[Convert.ToInt32(index)].Cells[3].Value); string Category = Convert.ToString(datagrid.Rows[Convert.ToInt32(index)].Cells[4].Value); string Sex = Convert.ToString(datagrid.Rows[Convert.ToInt32(index)].Cells[5].Value); string Color = Convert.ToString(datagrid.Rows[Convert.ToInt32(index)].Cells[6].Value); if (BandNumber != "") { if ((string)datagrid.CurrentCell.Value.ToString() == "DELETE") { if ((MessageBox.Show("Are you sure! You would like to delete this record?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)) { ActionType = "DELETE"; string path = ReadText.ReadFilePath("datapath"); string[] pigeonList = SetPigeonList(ActionType, BandNumber, RFID).ToArray(); string dateString = this.dateTimePicker1.Value.Year.ToString() + this.dateTimePicker1.Value.Month.ToString().PadLeft(2, '0') + this.dateTimePicker1.Value.Day.ToString().PadLeft(2, '0'); string entryDirectory = path + "\\entry\\" + dateString; string filepath = entryDirectory + "\\" + txtMemberID.Text + ".txt"; if (File.Exists(filepath)) { File.Delete(filepath); } System.IO.File.WriteAllLines(filepath, pigeonList); GetPigeonList(txtMemberID.Text); ActionType = ""; this.btnRead.Focus(); MessageBox.Show("Record Deleted.", "Delete Record"); } } } } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error"); } }
/// <summary> /// 更新持仓单信息 /// </summary> void UpdatePostion() { var click = new iAutomationElement(); if (ZT_PositionOrder != null) { click.InvokeButton(ZT_PositionOrder); GetZT_OutPutElement(); if (ZT_Output != null) { click.InvokeButton(ZT_Output); GetZT_OutPutSuessElement(); if (ZT_OutputSuess != null) { click.InvokeButton(ZT_OutputSuess); Thread.Sleep(500); var uielement = new iAutomationElement(); var elementlist = uielement.enumRoot(); elementlist = uielement.FindByClassName("Notepad", elementlist); uielement.CloseTextBook(elementlist[0]); var list = ReadText.Read(); foreach (var item in list) { string[] array = item.Split(new char[] { '|' }); var data = new DataItem(); data.data = array; if (!ZT_DataList.ContainsKey(array[0])) { ZT_DataList.Add(array[0], data); } else { //若标记为空更新全部数据 if (ZT_DataList[array[0]].data[18] == "") { ZT_DataList[array[0]] = data; } else { data.data[18] = "1"; ZT_DataList[array[0]] = data; } } } } } } }
private Boolean SavetoFile(string MemberIDNo, string RFID) { try { // string[] pigeonEntry = {RFID}; string path = ReadText.ReadFilePath("datapath"); string dateString = this.dateTimePicker1.Value.Year.ToString() + this.dateTimePicker1.Value.Month.ToString().PadLeft(2, '0') + this.dateTimePicker1.Value.Day.ToString().PadLeft(2, '0'); string entryDirectory = path + "\\entry\\" + dateString; string filepath = entryDirectory + "\\" + MemberIDNo + ".txt"; string[] pigeonEntry = SetPigeonList(ActionType, this.txtRingNumber.Text, RFID).ToArray(); if (File.Exists(filepath)) { File.Delete(filepath); } if (!Directory.Exists(entryDirectory)) { Directory.CreateDirectory(entryDirectory); } if (File.Exists(filepath)) { string[] entryList = ReadText.ReadTextFile(filepath); if (entryList.Contains(RFID)) { MessageBox.Show("Bird Already Entry."); return(false); } else { System.IO.File.WriteAllLines(filepath, pigeonEntry); //entrylist } } else { System.IO.File.WriteAllLines(filepath, pigeonEntry); //entrylist } return(true); } catch (Exception ex) { throw ex; } }
// Use this for initialization void Start() { string ss = ReadText.readTextFile(sText); GetDaTa(ss); maxlevel = DataController.GetHightScore(); SoundController.Instance.PlayBatDau(); //suget(); StartCoroutine(WaitTimeLoadData(5f)); }
// Use this for initialization void Start() { string ss = ReadText.readTextFile(sText); GetDaTa(ss); btnPower.OnClick += btnPower_OnClick; maxlevel = DataController.GetHightScore(); SoundController.Instance.PlayBatDau(); //suget(); }
public string UpdateCheck() { string ReadText; try { string UrlAdress = "http://download.exlb.org/verizon.asp?airshipmodmaker";//测试版 System.IO.Stream stream = System.Net.WebRequest.Create(UrlAdress).GetResponse().GetResponseStream(); //注意urladress为你上面的网页地址。 StreamReader sr = new StreamReader(stream, System.Text.Encoding.UTF8); ReadText = sr.ReadToEnd(); //由于这里并非读取全部文件,这里正常为空 sr.Dispose(); //关闭流 ReadText = System.Uri.UnescapeDataString(ReadText); } catch (Exception ex) { MessageBox.Show(ex.Message + "\nForm:\n" + ex.Source, "{Plese Send to Author} Update Check Web Error"); return(""); } try { string[] tmps = ReadText.Split('\n'); if (tmps.First().Contains(Program.version)) { return(""); } ReadText = "What's New"; foreach (string tmp in tmps) { if (!tmp.Contains(Program.version)) { ReadText += "\n" + tmp; } else { break; } } return(ReadText); } catch (Exception ex) { MessageBox.Show(ex.Message + "\nForm:\n" + ex.Source, "{Plese Send to Author} Update Check Error: " + ex.Source); return(""); } }
private void GetMemberName(string memberID) { try { string path = ReadText.ReadFilePath("datapath"); string filepath = path + "\\members\\" + memberID + ".txt"; if (File.Exists(filepath)) { string[] memberDetails = ReadText.ReadTextFile(filepath); this.txtName.Text = memberDetails[1].ToString(); } } catch (Exception ex) { throw ex; } }
// Use this for initialization void Start() { string ss = ReadText.readTextFile(sText); GetDaTa(ss); btnPower.OnClick += btnPower_OnClick; maxlevel = DataController.GetHightScore(); checkRedQuestionOpen = DataController.GetRedQuestion(); SoundController.Instance.PlayBatDau(); mInApp = DataController.GetInApp(); mInApp++; DataController.SaveInApp(mInApp); //suget(); }
private bool CheckRemarks(string remarks, string filepath) { try { if (File.Exists(filepath)) { string[] pigeonCollection = ReadText.ReadTextFile(filepath); if (pigeonCollection.Contains(remarks)) { return(true); } } return(false); } catch (Exception ex) { throw ex; } }
static void Main(string[] args) { string path = AppDomain.CurrentDomain.BaseDirectory; string filepath = path + "resultinfo.txt"; string Actionfilepath = path + "Action.txt"; string[] pigeonCollection = ReadText.ReadTextFile(filepath); string[] actionValue = ReadText.ReadTextFile(Actionfilepath); if (actionValue[0].ToUpper() == "RESULTRACE") { MemberID = pigeonCollection[0]; DateRelease = pigeonCollection[1]; DataPath = pigeonCollection[2].Trim(); GetResult("RACE"); } if (actionValue[0].ToUpper() == "RESULTTRAINING") { MemberID = pigeonCollection[0]; DateRelease = pigeonCollection[1]; DataPath = pigeonCollection[2].Trim(); GetResult("TRAINING"); } else if (actionValue[0].ToUpper() == "RESULTDB") { ClubName = pigeonCollection[0]; DateRelease = pigeonCollection[1]; DataPath = pigeonCollection[2].Trim(); ReleaseDate = Convert.ToDateTime(pigeonCollection[3]); SyncResultToDatabase(); } else if (actionValue[0].ToUpper() == "ENTRYDB") { ClubName = pigeonCollection[0]; DateRelease = pigeonCollection[1]; DataPath = pigeonCollection[2].Trim(); ReleaseDate = Convert.ToDateTime(pigeonCollection[3]); SyncEntryToDatabase(); } }
// Use this for initialization void Start() { try { string ss = ReadText.readTextFile(sText); GetDaTa(ss); maxlevel = DataController.GetHightScore(); SoundController.Instance.PlayBatDau(); AdController.instance.LoadAdsBanner(); //suget(); StartCoroutine(WaitTimeLoadData(5f)); } catch (System.Exception) { throw; } }
private void button3_Click(object sender, EventArgs e) { if (MessageBox.Show("Are you want to delete this record(s)?", "Delete", MessageBoxButtons.YesNo) == DialogResult.Yes) { string path = ReadText.ReadFilePath("datapath"); //string filepath = path + "\\pigeonlist\\" + MemberID + ".txt"; foreach (string item in this.listBox1.Items) { string[] col = item.Split('|'); string pigeonMobileListPath = path + "\\PigeonMobileList\\" + col[0].ToString().Trim() + ".txt"; if (File.Exists(pigeonMobileListPath)) { File.Delete(pigeonMobileListPath); } } MessageBox.Show("Record(s) Deleted"); this.listBox1.Items.Clear(); GetPigeonList(); } }
public static void Logs(string ErrorMessage) { string path = ReadText.ReadFilePath("datapath"); string dateString = DateTime.Today.Year.ToString() + DateTime.Today.Month.ToString().PadLeft(2, '0') + DateTime.Today.Day.ToString().PadLeft(2, '0'); string errorLogs = path + @"\" + dateString + ".txt"; if (File.Exists(errorLogs)) { using (StreamWriter sw = File.AppendText(errorLogs)) { sw.WriteLine(ErrorMessage); } } else { using (StreamWriter sw = File.CreateText(errorLogs)) { sw.WriteLine(ErrorMessage); } } }
private void button1_Click(object sender, EventArgs e) { if (this.listBox1.Items.Count > 0) { string path = ReadText.ReadFilePath("datapath"); //string filepath = path + "\\pigeonlist\\" + MemberID + ".txt"; foreach (string item in this.listBox1.Items) { string[] col = item.Split('|'); string pigeonMobileListPath = path + "\\PigeonMobileList\\" + col[0].ToString().Trim() + ".txt"; if (this.txtName.Text != "" && this.txtMobileNumber.Text != "") { string[] mvalue = { this.txtName.Text + "|" + this.txtMobileNumber.Text }; System.IO.File.WriteAllLines(pigeonMobileListPath, mvalue); //memberpigeonlist } } MessageBox.Show("Record(s) Save."); this.listBox1.Items.Clear(); GetPigeonList(); } }