Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature currently requires accessing the site using the built-in Safari browser.
Hallo Peter, das ist überhaupt kein Problem. Ich habe mich eh nach erfolgreich abgeschicktem Post ins Wochenende und in den Biergarten verabschiedet, so dass die Erklärung sonst ziemlich spät gekommen wäreNicht böse sein MCoder, dass ich deinen Code kommentiere
Hallo Termy2007, die StringBuilder-Klasse müsstest du mitWelche Headerdatei deklariert den "Stringbuilder"?
using namespace System::Text;
CharEnumerator enumerator = txt.GetEnumerator();
StringBuilder sb = new StringBuilder();
progressBar1->Value = 0;
progressBar1->Maximum = 5;//Convert::ToInt32(textBox1->Text->GetEnumerator());
System::String ^text = textBox1->Text;
int i = 1;
int text_lenth = 5;//progressBar1->Maximum;
int text2_lenth = 0;//Convert::ToInt32(textBox2->Text->GetEnumerator());
while (i <= text_lenth)
{
char current_char = Convert::ToChar(text->Substring(i, 1));
Int16 myInt = (short)current_char;
textBox2->Text->Insert(text2_lenth, myInt >= 128?"1":"0");
if (myInt >= 128) myInt -= 128;
textBox2->Text->Insert(text2_lenth, myInt >= 64? "1" : "0");
if (myInt >= 64) myInt -= 64;
textBox2->Text->Insert(text2_lenth, myInt >= 32? "1" : "0");
if (myInt >= 32) myInt -= 32;
textBox2->Text->Insert(text2_lenth, myInt >= 16 ? "1" : "0");
if (myInt >= 16) myInt -= 16;
textBox2->Text->Insert(text2_lenth, myInt >= 8 ? "1" : "0");
if (myInt >= 8) myInt -= 8;
textBox2->Text->Insert(text2_lenth, myInt >= 4 ? "1" : "0");
if (myInt >= 4) myInt -= 4;
textBox2->Text->Insert(text2_lenth, myInt >= 2 ? "1" : "0");
if (myInt >= 2) myInt -= 2;
textBox2->Text->Insert(text2_lenth, myInt >= 1 ? "1" : "0");
if (myInt >= 1) myInt -= 1;
i++;
}
int i = 1;
while (i <= text_lenth)
{
}
int i = 0;
while (i < text_lenth)
{
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
string txt = textBox1.Text;
StringBuilder sb = new StringBuilder();
CharEnumerator enumerator = txt.GetEnumerator();
while (enumerator.MoveNext())
{
Char c = enumerator.Current;
Int16 myInt = (short)c;
sb.Append(myInt >= 128 ? "1" : "0");
if (myInt >= 128) myInt -= 128;
sb.Append(myInt >= 64 ? "1" : "0");
if (myInt >= 64) myInt -= 64;
sb.Append(myInt >= 32 ? "1" : "0");
if (myInt >= 32) myInt -= 32;
sb.Append(myInt >= 16 ? "1" : "0");
if (myInt >= 16) myInt -= 16;
sb.Append(myInt >= 8 ? "1" : "0");
if (myInt >= 8) myInt -= 8;
sb.Append(myInt >= 4 ? "1" : "0");
if (myInt >= 4) myInt -= 4;
sb.Append(myInt >= 2 ? "1" : "0");
if (myInt >= 2) myInt -= 2;
sb.Append(myInt >= 1 ? "1" : "0");
if (myInt >= 1) myInt -= 1;
sb.Append(" ");
}
textBox2.Text = sb.ToString();
}
}
}
Das muss aber so aussehen :
Code:int i = 0; while (i < text_lenth) { }
Nicht ganz! MS VC++ 2005 ExpressDu verwendest doch auch MS VS2005 oder?
Code:using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms;