Servus,
ich habe hier ein riesen Problem. (Für mich zumindest)
Ich bin im Programmieren eine totale Niete! Jedoch habe ich bei uns in der Feuerwehr nun ein Programm bekommen, das ich erweitern soll. Ich habe mich nun schon seit 4 Wochen damit auseinander gesetzt. Jedoch komme ich nicht wirklich dahinter, was da abläuft bzw. wie ich es erweitern kann.
Kann mir jemand helfen?
Es ist so. Bei uns kommt bei einem Einsatz ein Fax an. Dies wird derzeit ausgewertet und in eine Datenbank gespeichert. Das läuft auch alles wunderbar. Nur soll die Auswertung des Faxes nun erweitert werden. Hier ist mal ein Teil des derzeitigen Codes:
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99:
| public Einsatz ParseEinsatz(string file) { Einsatz einsatz = new Einsatz(); string str = string.Empty; bool flag = true; int num = 0; while (flag) { flag = false; num++; try { StreamReader reader = new StreamReader(file); while ((str = reader.ReadLine()) != null) { int index = str.IndexOf(':'); if (index != -1) { string str3 = str.Substring(0, index); string str2 = str.Substring(index + 1).Trim(); if (this.replaceList != null) { foreach (ReplaceString str4 in this.replaceList) { str2 = str2.Replace(str4.OldString, str4.NewString); } } switch (str3.Trim().ToUpperInvariant()) { case "E — NR": einsatz.Einsatznr = str2; break; case "MITTEILER": einsatz.Mitteiler = str2; break; case "EINSATZORT": einsatz.Einsatzort = str2; break; case "STRA\x00dfE": case "STRABE": einsatz.Strasse = str2; break; case "KREUZUNG": einsatz.Kreuzung = str2; break; case "ORTSTEIL/ORT": einsatz.Ort = str2; break; case "OBJEKT": case "9BJEKT": einsatz.Objekt = str2; break; case "MELDEBILD": einsatz.Meldebild = str2; break; case "HINWEIS": einsatz.Hinweis = str2; break; case "EINSATZSTICHWORT": einsatz.Einsatzstichwort = str2; break; case "EINSATZPLAN": einsatz.Einsatzplan = str2; break; } } } reader.Close(); continue; } catch (FileNotFoundException exception) { if (num < 10) { flag = true; Thread.Sleep(0x3e8); this.logger.WriteWarning("Ocr file not found. Try " + num.ToString(CultureInfo.InvariantCulture) + " of 10!"); } else { this.logger.WriteError("Ocr File not found! " + exception.ToString()); } continue; } catch (Exception exception2) { this.logger.WriteError(exception2.ToString()); continue; } } return einsatz; |
Danke.
Gruß
Matze
Moderiert von
Christian S.: C#-Tags hinzugefügt