it look something like that
/*Created by Rminator
* Date 16/05/2011
* Time: 10:17
*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using Microsoft.VisualBasic;
namespace Auswertesoftware
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
//dplot.DPlot_FindDPLOTLIB();
//dplot.DPlot_SetErrorMethod((2));
}
private void openFileDialog1_FileOk(object sender, CancelEventArgs e)
{
}
private void openToolStripMenuItem_Click(object sender, EventArgs e)
{
String Choosen_File = "";
OpenFD.InitialDirectory = "C:";
OpenFD.Title = " Open a LoggFile";
OpenFD.FileName = "";
OpenFD.Filter = "All files (*.*)|*.*|All files (*.*)|*.*";
//"Textdokument|*.txt|World Documents|*.doc|Microsoft Excel-Arbeitsblatt|*.|Textdokument|*.log|";
//"TextFiles|*.txt|Word Documents|*.doc";
if (OpenFD.ShowDialog() != DialogResult.Cancel)
{
Choosen_File = OpenFD.FileName;
richTextBox1.LoadFile(Choosen_File, RichTextBoxStreamType.PlainText);
}
else
{
MessageBox.Show("Cancel Button Clicked");
}
}
private void saveToolStripMenuItem_Click(object sender, EventArgs e)
{
String Save_File = "";
SaveFD.InitialDirectory = ":Y";//We're setting the default folder to be C
SaveFD.Title = "Save a LogFile";
SaveFD.FileName = "";
SaveFD.Filter = "All files (*.*)|*.*|All files (*.*)|*.*";
//"Textdokument|*.txt|World Documents|*.doc|Microsoft Excel-Arbeitsblatt|*.";// we´re Setting the Type of File we´re abble to be Open
if (SaveFD.ShowDialog() != DialogResult.Cancel)
{
Save_File = SaveFD.FileName;
richTextBox1.SaveFile(Save_File, RichTextBoxStreamType.PlainText);//The RichTextBox can open plain text files as well as Word documents
}
else
{
MessageBox.Show("Cancel Button Clicked");
}
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
string myStr;
using (FileStream fs = File.OpenRead(OpenFD.FileName))
{
byte[] buffer = new byte[fs.Length];
fs.Read(buffer, 0, buffer.Length);
myStr = Encoding.Default.GetString(buffer);
FileInfo fi2 = new FileInfo(SaveFD.FileName);
if (fi2.Exists)
{
StreamWriter sw = new StreamWriter(fi2.FullName, true, Encoding.Default);
sw.Write(myStr);
sw.Close();
}
}
}
private void button2_Click(object sender, EventArgs e)
{
// Read in a file line-by-line, and store it all in a List.
String[] StArr = null; char[] _Delimiters_char = { ' ', ';', ',' };
int count = 0;
foreach (String line in richTextBox1.Lines)
{ StArr = line.Split(_Delimiters_char);
for (count = 0; count < StArr.Length; count++)
{ listBox1.Items.Add(StArr[count]); }//MessageBox.Show(StArr[count]); }
}
using (StreamReader reader = new StreamReader(OpenFD.FileName))// Instance von der Klasse Streamreader,Zeillenweises lesen eine Datei
{
string line = null ;
//String[] StArr = null;
//char [] _Delimiters_char = {';',' '};
//int count = 0;
//StArr = line.Split(_Delimiters_char);
//while (VisibleString.Contains(" ")) { VisibleString.Replac(" ", ""); }
do
{
line = reader.ReadLine();
//while (line.Contains(" ")) { line.Replace(" ", ""); }
if (line.Contains(" "))
{
line = line.Replace(" ", "");
}
StArr = line.Split(_Delimiters_char);
for (count = 0; count <= StArr.Length - 1; count++)
{
listBox1.Items.Add(StArr[count]);
//count++;
}
count++;
}
while ((line = reader.ReadLine()) != null );
}
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void Form1_Paint(object sender, PaintEventArgs e)
{
int cx = ClientSize.Width;
int cy = ClientSize.Height;
Graphics g = e.Graphics;
PointF[] aptf = new PointF[cx];
for (int i = 0; i < cx; i++)
{
aptf[i].X = i;
aptf[i].Y = cy / 2 * (1 - (float)Math.Sin(i * 2 * Math.PI / (cx - 1)));
}
g.DrawLines(new Pen(Color.BlueViolet), aptf);
/*My_Pen.DashStyle = System.Drawing.Drawing2D.DashStyle.DashDotDot;
My_Pen.Color = System.Drawing.Color.RoyalBlue;
My_Pen.Width = 4;*/
}
private void button3_Click(object sender, EventArgs e)
{
}
private void richTextBox1_TextChanged(object sender, EventArgs e)
{
}
}
}