fsdfdfsdf
sdfsdfsdf
Schieße wo kriege ich jetzt Code her hm
Mal sehen wann der abschneidet
Yo war zu lang grade mal 20000 zeichen sind erlaubt
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using Serveruclient;
namespace Serveruclient
{
public partial class FormSql : Form
{
private delegate void SetTextCallback(string text);
private SqlDatabase sql = SqlDatabase.SingeltonFactory();
public FormSql()
{
InitializeComponent();
Thread shelp = new Thread(InitSql);
shelp.Start();
}
private void InitSql()
{
while (true)
{
lock (this)
{
ThreadPool.QueueUserWorkItem(new WaitCallback(this.WriteText), sql.OldData());
}
Thread.Sleep(10000);
}
}
private void WriteText(object text)
{
if (textBox1.InvokeRequired)
{
SetTextCallback d = new SetTextCallback(WriteText);
textBox1.Invoke(d, new object[] { text });
}
else
{
textBox1.Text = (string)text;
textBox1.SelectionStart = textBox1.Text.Length;
textBox1.ScrollToCaret();
}
}
private void Refresh_Click(object sender, EventArgs e)
{
textBox1.Text = sql.OldData();
textBox1.SelectionStart = textBox1.Text.Length;
textBox1.ScrollToCaret();
}
}
}