Stilllegung des Forums
Das Forum wurde am 05.06.2023 nach über 20 Jahren stillgelegt (weitere Informationen und ein kleiner Rückblick).
Registrierungen, Anmeldungen und Postings sind nicht mehr möglich. Öffentliche Inhalte sind weiterhin zugänglich.
Das Team von spieleprogrammierer.de bedankt sich bei der Community für die vielen schönen Jahre.
Wenn du eine deutschsprachige Spieleentwickler-Community suchst, schau doch mal im Discord und auf ZFX vorbei!
Werbeanzeige
C#-Quelltext |
|
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 100 101 102 103 104 |
using System; using System.Collections.Generic; using System.Text; using System.Diagnostics; using System.Collections; using System.IO; using System.Windows.Forms; namespace Hexconverter { class Program { static void Main(string[] args) { //int i = 1; { string path = Console.ReadLine(); if (File.Exists(path)==true) { // Open the file to read from. string readText = File.ReadAllText(path); char[] values = readText.ToCharArray(); foreach (char letter in values) { // Get the integral value of the character. int value = Convert.ToInt32(letter); // Convert the decimal value to a hexadecimal value in string form. string hexOutput = String.Format("{0:X}", value); //Console.WriteLine(i++); Console.Write("{1} ", letter, hexOutput, readText); } } else { Environment.Exit(0); } Console.WriteLine(""); string path1 = Console.ReadLine(); if (File.Exists(path1) == true) { { // Open the file to read from. string readText1 = File.ReadAllText(path1); char[] values1 = readText1.ToCharArray(); foreach (char letter1 in values1) { // Get the integral value of the character. int value1 = Convert.ToInt32(letter1); // Convert the decimal value to a hexadecimal value in string form. string hexOutput = String.Format("{0:X}", value1); //Console.WriteLine(i++); if (path.Length != path1.Length) { Console.Write("{1} ", letter1, hexOutput, readText1); } } } } else { Environment.Exit(0); } string MyString = path; Console.WriteLine(String.Compare(MyString, path1)); if (MyString == path1) { Console.WriteLine("Gleich!"); } else { { MyForm form = new MyForm(); form.lblText1 = MyString; //Hier tritt der Fehler auf (MyString) form.Show(); } } Console.ReadKey(); } } } } |
Quellcode |
|
1 |
form.lblText1.Text = MyString; |
Z.91
Quellcode
1 form.lblText1.Text = MyString;
lblText1 ist vom Typ Label, MyString vom Typ String.
C#-Quelltext |
|
1 2 3 4 |
MyForm form = new MyForm(); form.lblText1.Text = readText1; form.Show(); //Console.Write("{1} ", letter1, hexOutput, readText1); |
Community-Fossil
Beruf: Teamleiter Mobile Applikationen & Senior Software Engineer
Quellcode |
|
1 |
MyForm form = new MyForm(); |
Quellcode |
|
1 |
form.Show(); |
Quellcode |
|
1 |
form.lblText1.Text = readText1; |
Es wird vermutlich deswegen unendlich oft geöffnet, weil Du nicht den kompletten Code gezeigt hast und da irgendwo eine Schleife vorliegt.
C#-Quelltext |
|
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 100 101 102 103 104 105 106 |
using System; using System.Collections.Generic; using System.Text; using System.Diagnostics; using System.Collections; using System.IO; using System.Windows.Forms; namespace Hexconverter { class Program { static void Main(string[] args) { //int i = 1; { string path = Console.ReadLine(); if (File.Exists(path) == true) { // Open the file to read from. string readText = File.ReadAllText(path); char[] values = readText.ToCharArray(); foreach (char letter in values) { // Get the integral value of the character. int value = Convert.ToInt32(letter); // Convert the decimal value to a hexadecimal value in string form. string hexOutput = String.Format("{0:X}", value); //Console.WriteLine(i++); Console.Write("{1} ", letter, hexOutput, readText); } } else { Environment.Exit(0); } Console.WriteLine(""); string path1 = Console.ReadLine(); if (File.Exists(path1) == true) { { // Open the file to read from. string readText1 = File.ReadAllText(path1); char[] values1 = readText1.ToCharArray(); foreach (char letter1 in values1) { // Get the integral value of the character. int value1 = Convert.ToInt32(letter1); // Convert the decimal value to a hexadecimal value in string form. string hexOutput = String.Format("{0:X}", value1); //Console.WriteLine(i++); { Console.Write("{1} ", letter1, hexOutput, readText1); } } } } else { Environment.Exit(0); } { MyForm form = new MyForm(); form.lblText1.Text = path; form.lblText2.Text = path1; form.Show(); } string MyString = path; Console.WriteLine(String.Compare(MyString, path1)); if (MyString == path1) { Console.WriteLine("Gleich!"); } else { { Console.WriteLine("Nicht Gleich!"); } } Console.ReadKey(); } } } } |
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »layle« (03.05.2014, 10:21)
Community-Fossil
Beruf: Teamleiter Mobile Applikationen & Senior Software Engineer
Community-Fossil
Beruf: Teamleiter Mobile Applikationen & Senior Software Engineer
Das ist halt der Schrott, wenn er seinen Code ständig editiert. Das hat er in seinem anderen Topic auch schon gemacht. Der Code sah vorher ganz anders aus. Daraus lernt hinterher keiner mehr was und es entsteht nur Verwirrung.
Werbeanzeige