Laden...

Forumsprogramm

Erstellt von Floste vor 15 Jahren Letzter Beitrag vor 14 Jahren 10.168 Views
Floste Themenstarter:in
1.130 Beiträge seit 2007
vor 15 Jahren
Forumsprogramm

Ich möchte mal sehen, was passiert, wenn wir ein 'Forumsprogramm' schreiben. Herauskommen soll ein Miniprogramm, das sich compilieren und ausführen lässt.

Regeln:
Jeder darf an irgendeiner Stelle eine Anweisung oder ein Konstrukt mit den dazugehörigen Klammern einfügen. Dabei dürfen bestehende Zeilen nicht verändert und deren Reigenfolge nicht geändet werden. Neue Klammern dürfen aber bestehende Zeilen umschließen.
Neue Member und Klassen müssen als Stubs eingefügt werden, sobald sie in einer Anweisung verwendet werden.


namespace ForumsProgramm
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
             string s="Bye, World!";
        }
    }
}

Projekte:Jade, HttpSaver
Zum Rechtschreiben gibts doch schon die Politiker. Aber die bauen auch nur mist!

H
364 Beiträge seit 2007
vor 15 Jahren

using System.Windows.Forms;

namespace ForumsProgramm
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
             string s="Bye, World!";
        }
    }
}
1.002 Beiträge seit 2007
vor 15 Jahren

using System.Windows.Forms;

namespace ForumsProgramm
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
             string s="Bye, World!";
        }

        static void SaySomething(string s)
        {
            MessageBox.Show(s, "Something very important to say");
        }
    }
}

Mein Blog: blog.mariusschulz.com
Hochwertige Malerarbeiten in Magdeburg und Umgebung: M'Decor, Ihr Maler für Magdeburg

H
364 Beiträge seit 2007
vor 15 Jahren
using System.Windows.Forms;

namespace ForumsProgramm
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
             string s="Bye, World!";
             this.SaySomething(s);
        }

        static void SaySomething(string s)
        {
            MessageBox.Show(s, "Something very important to say");
        }
    }
}
946 Beiträge seit 2008
vor 15 Jahren
using System.Windows.Forms;

namespace ForumsProgramm
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
             string s="Bye, World!";
             //this.SaySomething(s);
             Program.SaySomething(s);
        }

        static void SaySomething(string s)
        {
            MessageBox.Show(s, "Something very important to say");
        }
    }
}
Floste Themenstarter:in
1.130 Beiträge seit 2007
vor 15 Jahren
using System.Windows.Forms;

namespace ForumsProgramm
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
             if(haveApocalypse())
             {
                 string s="Bye, World!";
                 //this.SaySomething(s);
                 Program.SaySomething(s);
             }
        }

        static void SaySomething(string s)
        {
            MessageBox.Show(s, "Something very important to say");
        }

        static bool haveApocalypse()
        {
        }
    }
}

Projekte:Jade, HttpSaver
Zum Rechtschreiben gibts doch schon die Politiker. Aber die bauen auch nur mist!

83 Beiträge seit 2007
vor 15 Jahren

using System.Windows.Forms;
using System.Xml.Linq;

namespace ForumsProgramm
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
             if(haveApocalypse())
             {
                 string s="Bye, World!";
                 //this.SaySomething(s);
                 Program.SaySomething(s);
             }
        }

        static void SaySomething(string s)
        {
            MessageBox.Show(s, "Something very important to say");
        }

        static bool haveApocalypse()
        {
        }
    }
}

Floste Themenstarter:in
1.130 Beiträge seit 2007
vor 15 Jahren
using System.Windows.Forms;
using System.Xml.Linq;

[assembly:Divine]

class DivineAttribute:Attribute
{
}

namespace ForumsProgramm
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
             if(haveApocalypse())
             {
                 string s="Bye, World!";
                 //this.SaySomething(s);
                 Program.SaySomething(s);
             }
        }

        static void SaySomething(string s)
        {
            MessageBox.Show(s, "Something very important to say");
        }

        static bool haveApocalypse()
        {
        }
    }
}

Projekte:Jade, HttpSaver
Zum Rechtschreiben gibts doch schon die Politiker. Aber die bauen auch nur mist!

83 Beiträge seit 2007
vor 15 Jahren

using System.Windows.Forms;
using System.Xml.Linq;

[assembly:Divine]

class DivineAttribute:Attribute
{
}

namespace ForumsProgramm
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
             if(haveApocalypse())
             {
                 string s="Bye, World!";
                 //this.SaySomething(s);
                 Program.SaySomething(s);
             }
        }

        static void SaySomething(string s)
        {
            MessageBox.Show(s, "Something very important to say");
        }

        static bool haveApocalypse()
        {
            XDocument XDoc = new XDocument();
        }
    }
}

Noch eine kleine Frage: Wie kann ich das alles compilieren?
Unter VS 2008 (Express) kennt er "[STAThread]" nicht und hat etwas gegen "[assembly:Divine]" sowie gegen "DivineAttribute : Attribute" (in beiden Fällen kann der Typ- oder Namespace nicht gefunden werden). Außerdem erhalte ich noch die Meldung '"DivineAttribute": ist keine Attributklasse'.

Floste Themenstarter:in
1.130 Beiträge seit 2007
vor 15 Jahren
using System.Windows.Forms;
using System.Xml.Linq;
using System;

[assembly:Divine]

class DivineAttribute:Attribute
{
}

namespace ForumsProgramm
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
             if(haveApocalypse())
             {
                 string s="Bye, World!";
                 //this.SaySomething(s);
                 Program.SaySomething(s);
             }
        }

        static void SaySomething(string s)
        {
            MessageBox.Show(s, "Something very important to say");
        }

        static bool haveApocalypse()
        {
            XDocument XDoc = new XDocument();
        }
    }
}

Projekte:Jade, HttpSaver
Zum Rechtschreiben gibts doch schon die Politiker. Aber die bauen auch nur mist!

83 Beiträge seit 2007
vor 15 Jahren
using System.Windows.Forms;
using System.Xml.Linq;
using System;

[assembly:Divine]

class DivineAttribute:Attribute
{
}

namespace ForumsProgramm
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
             if(haveApocalypse())
             {
                 string s="Bye, World!";
                 //this.SaySomething(s);
                 Program.SaySomething(s);
             }
        }

        static void SaySomething(string s)
        {
            MessageBox.Show(s, "Something very important to say");
        }

        static bool haveApocalypse()
        {
            XDocument XDoc = new XDocument();
            if(File.Exists(String.Format("{0}\\{1}", System.IO.Path.GetDirectoryName (System.Reflection.Assembly.GetExecutingAssembly().Location), "settings.evil")))
            {

            }
        }
    }
}
1.346 Beiträge seit 2008
vor 15 Jahren

using System.Windows.Forms;
using System.Xml.Linq;
using System;

[assembly:Divine]

class DivineAttribute:Attribute
{
}

namespace ForumsProgramm
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
             if(haveApocalypse())
             {
                 string s="Bye, World!";
                 //this.SaySomething(s);
                 Program.SaySomething(s);
             }
        }

        static void SaySomething(string s)
        {
            MessageBox.Show(s, "Something very important to say");
        }

        static bool haveApocalypse()
        {
            XDocument XDoc = new XDocument();
            if(File.Exists(String.Format("{0}\\{1}", System.IO.Path.GetDirectoryName (System.Reflection.Assembly.GetExecutingAssembly().Location), "settings.evil")))
            {
               XDoc.Load(String.Format("{0}\\{1}", System.IO.Path.GetDirectoryName (System.Reflection.Assembly.GetExecutingAssembly().Location), "settings.evil"));
            }
        }
    }
}

Schuldigung aber der WYSIWYG-Editor hat wen ich auf Vorschau geklickt habe die Einrückungen entfernt .Ich musste auf den Standard Editor umschalten.

pdelvo

49.485 Beiträge seit 2005
vor 15 Jahren

Bitte verwendet mindestens bei langen Zeilen zwischendurch Leerzeichen, z.B. vor Kommas und öffnenden Klammern, sonst zerreißt es mindestens im Firefox das Layout. Wenn das nicht zuverlässig klappt, werde ich den Thread schließen, weil ich keine Lust habe, das dauernd nacheditieren zu müssen.

Achtet außerdem darauf, dass die Einrückung nicht verloren geht.

467 Beiträge seit 2007
vor 15 Jahren
using System.Windows.Forms;
using System.Xml.Linq;
using System;
using System.IO; //hat gefehlt.

[assembly: Divine]

class DivineAttribute : Attribute
{
}

namespace ForumsProgramm
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            if (haveApocalypse())
            {
                string s = "Bye, World!";
                //this.SaySomething(s);
                Program.SaySomething(s);
            }
        }

        static void SaySomething(string s)
        {
            MessageBox.Show(s, "Something very important to say");
        }

        static bool haveApocalypse()
        {
            XDocument XDoc = new XDocument();
            if (File.Exists(String.Format("{0}\\{1}",
                   System.IO.Path.GetDirectoryName (System.Reflection.Assembly.GetExecutingAssembly ().Location), 
                   "settings.evil")))
            {
                XDoc.Load(String.Format("{0}\\{1}",
                            System.IO.Path.GetDirectoryName (System.Reflection.Assembly.GetExecutingAssembly ().Location),
                              "settings.evil"));
            }
        }
    }
}
5.742 Beiträge seit 2007
vor 15 Jahren
using System.Windows.Forms;
using System.Xml.Linq;
using System;
using System.IO; //hat gefehlt.

[assembly: Divine]

class DivineAttribute : Attribute
{
}

namespace ForumsProgramm
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            Console.WriteLine("Hello world?");

            if (haveApocalypse())
            {
                string s = "Bye, World!";
                //this.SaySomething(s);
                Program.SaySomething(s);
            }
        }

        static void SaySomething(string s)
        {
            MessageBox.Show(s, "Something very important to say");
        }

        static bool haveApocalypse()
        {
            XDocument XDoc = new XDocument();
            if (File.Exists(String.Format("{0}\\{1}",
                   System.IO.Path.GetDirectoryName (System.Reflection.Assembly.GetExecutingAssembly ().Location), 
                   "settings.evil")))
            {
                XDoc.Load(String.Format("{0}\\{1}",
                            System.IO.Path.GetDirectoryName (System.Reflection.Assembly.GetExecutingAssembly ().Location),
                              "settings.evil"));
            }
        }
    }
}
49.485 Beiträge seit 2005
vor 15 Jahren

Aus gegeben Anlass noch einmal der Hinweis:

Bitte verwendet mindestens bei langen Zeilen (>80 Zeichen) zwischendurch Leerzeichen, z.B. vor Kommas und öffnenden Klammern, sonst zerreißt es mindestens im Firefox das Layout. Wenn das nicht zuverlässig klappt, werde ich den Thread schließen, weil ich keine Lust habe, das dauernd nacheditieren zu müssen.

83 Beiträge seit 2007
vor 15 Jahren

using System.Windows.Forms;
using System.Xml.Linq;
using System;
using System.IO; //hat gefehlt.

[assembly: Divine]

class DivineAttribute : Attribute
{
}

namespace ForumsProgramm
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            Console.WriteLine("Hello world?");

            if (haveApocalypse())
            {
                string s = "Bye, World!";
                //this.SaySomething(s);
                Program.SaySomething(s);
            }
        }

        static void SaySomething(string s)
        {
            MessageBox.Show(s, "Something very important to say");
        }

        static bool haveApocalypse()
        {
            String SFile = Path.GetDirectoryName (System.Reflection.Assembly.GetExecutingAssembly().Location);
            SFile += "\\settings.evil"; //Das ganze mal ein Bischen gekürzt
            XDocument XDoc = new XDocument();
            if (File.Exists(SFile))
            {
                XDoc = XDocument.Load(SFile);
            }
        }
    }
}

D
233 Beiträge seit 2008
vor 15 Jahren
using System.Windows.Forms;
using System.Xml.Linq;
using System;
using System.IO; //hat gefehlt.

[assembly: Divine]

class DivineAttribute : Attribute
{
}

namespace ForumsProgramm
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            Console.WriteLine("Hello world?");

            if (haveApocalypse())
            {
                string s = "Bye, World!";
                //this.SaySomething(s);
                Program.SaySomething(s);
            }
        }

        static void SaySomething(string s)
        {
            MessageBox.Show(s, "Something very important to say");
        }

        static bool haveApocalypse()
        {
            String SFile = Path.GetDirectoryName (System.Reflection.Assembly.GetExecutingAssembly().Location);
            SFile += "\\settings.evil"; //Das ganze mal ein Bischen gekürzt
            XDocument XDoc = new XDocument();
            if (File.Exists(SFile))
            {
                XDoc = XDocument.Load(SFile);
            }
            return XDoc != null;
        }
    }
}
Floste Themenstarter:in
1.130 Beiträge seit 2007
vor 15 Jahren

Bist du sicher, dass der Leser null sein kann, nachdem er mit new instaniert wurde?

Projekte:Jade, HttpSaver
Zum Rechtschreiben gibts doch schon die Politiker. Aber die bauen auch nur mist!

H
364 Beiträge seit 2007
vor 15 Jahren
using System.Windows.Forms;
using System.Xml.Linq;
using System;
using System.IO; //hat gefehlt.

[assembly: Divine]

class DivineAttribute : Attribute
{
}

namespace ForumsProgramm
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            Console.WriteLine("Hello world?");

            if (haveApocalypse())
            {
                string s = "Bye, World!";
                //this.SaySomething(s);
                Program.SaySomething(s);
            }
        }

        static void SaySomething(string s)
        {
            MessageBox.Show(s, "Something very important to say");
        }

        static bool haveApocalypse()
        {
            String SFile = Path.GetDirectoryName (System.Reflection.Assembly.GetExecutingAssembly().Location);
            SFile += "\\settings.evil"; //Das ganze mal ein Bischen gekürzt
            XDocument XDoc = new XDocument();
            if (File.Exists(SFile))
            {
                XDoc = XDocument.Load(SFile);
            }
            //return XDoc != null;
            return XDoc.Root != null;
        }
    }
}
5.742 Beiträge seit 2007
vor 15 Jahren

Bist du sicher, dass der Leser null sein kann, nachdem er mit new instaniert wurde?

Natürlich kann das passieren.
Es zeugt zwar nicht gerade von allerbestem Programmierstil in diesem Zusammenhang, aber es ist sehr wohl möglich, einer bereits initialisierten Variable null zuzuweisen.
Und da an jeder Stelle Codezeilen eingefügt werden dürfen, sehe ich daher kein Problem an der Entstehung des Rückgabewertes.
Außerdem ist der Code sytaktisch korrekt.

1.346 Beiträge seit 2008
vor 15 Jahren

using System.Windows.Forms;
using System.Xml.Linq;
using System;
using System.IO; //hat gefehlt.

[assembly: Divine]

class DivineAttribute : Attribute
{
}

namespace ForumsProgramm
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            Console.WriteLine("Hello world?");

            if (haveApocalypse())
            {
                string s = "Bye, World!";
                //this.SaySomething(s);
                Program.SaySomething(s);
                MakePanic(s);
            }
        }

        static void SaySomething(string s)
        {
            MessageBox.Show(s, "Something very important to say");
        }
        static void MakePanic(string reason)
        {

        }
        static bool haveApocalypse()
        {
            String SFile = Path.GetDirectoryName (System.Reflection.Assembly.GetExecutingAssembly().Location);
            SFile += "\\settings.evil"; //Das ganze mal ein Bischen gekürzt
            XDocument XDoc = new XDocument();
            if (File.Exists(SFile))
            {
                XDoc = XDocument.Load(SFile);
            }
            //return XDoc != null;
            return XDoc.Root != null;
        }
    }
}

268 Beiträge seit 2008
vor 15 Jahren

using System.Windows.Forms;
using System.Xml.Linq;
using System;
using System.IO; //hat gefehlt.

[assembly: Divine]

class DivineAttribute : Attribute
{
}

namespace ForumsProgramm
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            Console.WriteLine("Hello world?");

            if (haveApocalypse())
            {
                string s = "Bye, World!";
                //this.SaySomething(s);
                Program.SaySomething(s);
                MakePanic(s);
            }
        }

        static void SaySomething(string s)
        {
            MessageBox.Show(s, "Something very important to say");
        }
        static void MakePanic(string reason)
        {
            int i2=100;
            for (int i = 0;i<i2;i++)
            {
                MessageBox.Show("Panic Reason:"+reason, "Make Panic",MessageBoxButtons.OK);
            }

        }
        static bool haveApocalypse()
        {
            String SFile = Path.GetDirectoryName (System.Reflection.Assembly.GetExecutingAssembly().Location);
            SFile += "\\settings.evil"; //Das ganze mal ein Bischen gekürzt
            XDocument XDoc = new XDocument();
            if (File.Exists(SFile))
            {
                XDoc = XDocument.Load(SFile);
            }
            //return XDoc != null;
            return XDoc.Root != null;
        }
    }
}

Name: Scarecraft
Language:C#
learning since:winter 2007
IDE: Visual Studio 2005/08 Professional Editon
Skill:Medium
qualifications: MCP - Microsoft Certified Professional
Homepage : FX RPG Maker

1.200 Beiträge seit 2007
vor 15 Jahren

using System.Windows.Forms;
using System.Xml.Linq;
using System;
using System.IO; //hat gefehlt.

[assembly: Divine]

class DivineAttribute : Attribute
{
}

namespace ForumsProgramm
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            Console.WriteLine("Hello world?");

            if (haveApocalypse())
            {
                string s = "Bye, World!";
                //this.SaySomething(s);
                Program.SaySomething(s);
                MakePanic(s);
            }
        }

        static void SaySomething(string s)
        {
            MessageBox.Show(s, "Something very important to say");
        }
        
        static void MakePdelvosSigLookLikeProperEnglish(String replaceMakeWithDo)
        {
        }  
      
        static void CausePanic(string reason)
        //static void MakePanic(string reason)
        {
            int i2=100;
            for (int i = 0;i<i2;i++)
            {
                MessageBox.Show("Panic Reason:"+reason, "Incite Panic",MessageBoxButtons.OK);
            }

        }
        static bool haveApocalypse()
        {
            String SFile = Path.GetDirectoryName (System.Reflection.Assembly.GetExecutingAssembly().Location);
            SFile += "\\settings.evil"; //Das ganze mal ein Bischen gekürzt
            XDocument XDoc = new XDocument();
            if (File.Exists(SFile))
            {
                XDoc = XDocument.Load(SFile);
            }
            //return XDoc != null;
            return XDoc.Root != null;
        }
    }
}

Shift to the left, shift to the right!
Pop up, push down, byte, byte, byte!

YARRRRRR!

5.657 Beiträge seit 2006
vor 15 Jahren

Bist du sicher, dass der Leser null sein kann, nachdem er mit new instaniert wurde?
Natürlich kann das passieren.

Wie kommst du darauf? Wenn der Constructor einen Fehler verursacht, wird eine Exception geworfen, in allen anderen Fällen wird eine Instanz erzeugt!
Christian

Weeks of programming can save you hours of planning

5.742 Beiträge seit 2007
vor 15 Jahren

Natürlich kann das passieren.
Wie kommst du darauf? Wenn der Constructor einen Fehler verursacht, wird eine Exception geworfen, in allen anderen Fällen wird eine Instanz erzeugt!
Christian

Ja - dessen bin ich mir bewusst.

Eine Möglichkeit, die tatsächlich eintreten kann, habe ich ja aufgeführt:

Es zeugt zwar nicht gerade von allerbestem Programmierstil in diesem Zusammenhang, aber es ist sehr wohl möglich, einer bereits initialisierten Variable null zuzuweisen.

Wenn jemand den Code folgendermaßen abändert:


static bool haveApocalypse()
{
    //...
    XDocument XDoc = new XDocument();
    //...
        XDoc = null;
     
     return XDoc != null;
}

kann es Sinn machen, einen Rückgabewert auf so eine Weise zu erstellen.

467 Beiträge seit 2007
vor 15 Jahren
using System.Windows.Forms;
using System.Xml.Linq;
using System;
using System.IO; //hat gefehlt.

[assembly: Divine]

class DivineAttribute : Attribute
{
}

namespace ForumsProgramm
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            Console.WriteLine("Hello world?");

            if (haveApocalypse())
            {
                string s = "Bye, World!";
                //this.SaySomething(s);
                Program.SaySomething(s);
                //MakePanic(s); Methode nicht vorhanden, Name aktualisiert
                CausePanic(s)
            }
        }

        static void SaySomething(string s)
        {
            MessageBox.Show(s, "Something very important to say");
        }

        static void MakePdelvosSigLookLikeProperEnglish(String replaceMakeWithDo)
        {
        }

        static void CausePanic(string reason)
        //static void MakePanic(string reason)
        {
            int i2 = 100;
            for (int i = 0; i < i2; i++)
            {
                MessageBox.Show("Panic Reason:" + reason, "Incite Panic", MessageBoxButtons.OK);
            }

        }
        static bool haveApocalypse()
        {
            String SFile = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            SFile += "\\settings.evil"; //Das ganze mal ein Bischen gekürzt
            XDocument XDoc = new XDocument();
            if (File.Exists(SFile))
            {
                XDoc = XDocument.Load(SFile);
            }
            //return XDoc != null;
            return XDoc.Root != null;
        }
    }
}

ich warte darauf, dass der code auch mal kompilierbar ist 😉
die methode wurde aktualisiert, aber nicht der aufruf

83 Beiträge seit 2007
vor 15 Jahren

using System.Windows.Forms;
using System.Xml.Linq;
using System;
using System.IO; //hat gefehlt.
using System.Threading;

[assembly: Divine]

class DivineAttribute : Attribute
{
}

namespace ForumsProgramm
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            Thread t = new Thread(EvileBackgroundThread);
            t.Start();
            Console.WriteLine("Hello world?");

            if (haveApocalypse())
            {
                string s = "Bye, World!";
                //this.SaySomething(s);
                Program.SaySomething(s);
                //MakePanic(s); Methode nicht vorhanden, Name aktualisiert
                CausePanic(s);
            }
        }

        static void SaySomething(string s)
        {
            MessageBox.Show(s, "Something very important to say");
        }

        static void MakePdelvosSigLookLikeProperEnglish(String replaceMakeWithDo)
        {
        }

        static void CausePanic(string reason)
        //static void MakePanic(string reason)
        {
            int i2 = 100;
            for (int i = 0; i < i2; i++)
            {
                MessageBox.Show("Panic Reason:" + reason, "Incite Panic", MessageBoxButtons.OK);
            }

        }

        static void EvileBackgroundThread()
        {
        }

        static bool haveApocalypse()
        {
            String SFile = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            SFile += "\\settings.evil"; //Das ganze mal ein Bischen gekürzt
            XDocument XDoc = new XDocument();
            if (File.Exists(SFile))
            {
                XDoc = XDocument.Load(SFile);
            }
            //return XDoc != null;
            return XDoc.Root != null;
        }
    }
}

Hab mal ein paar mehrZeilen eingefügt, da dass ganze sonst keinen Sinn macht, ich hoffe, dass gilt. :evil:

479 Beiträge seit 2008
vor 15 Jahren
using System.Windows.Forms;
using System.Xml.Linq;
using System;
using System.IO; //hat gefehlt.
using System.Threading;

[assembly: Divine]

class DivineAttribute : Attribute
{
}

namespace ForumsProgramm
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            Console.WriteLine("Hello world?");

            if (haveApocalypse())
            {
                string s = "Bye, World!";
                //this.SaySomething(s);
                Program.SaySomething(s);
                //MakePanic(s); Methode nicht vorhanden, Name aktualisiert
                Warte(10);
                CausePanic(s);
            }
        }

        static void SaySomething(string s)
        {
            MessageBox.Show(s, "Something very important to say");
        }

        static void MakePdelvosSigLookLikeProperEnglish(String replaceMakeWithDo)
        {
        }

        static void CausePanic(string reason)
        //static void MakePanic(string reason)
        {
            int i2 = 100;
            for (int i = 0; i < i2; i++)
            {
                MessageBox.Show("Panic Reason:" + reason, "Incite Panic", MessageBoxButtons.OK);
            }

        }
        static bool haveApocalypse()
        {
            String SFile = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            SFile += "\\settings.evil"; //Das ganze mal ein Bischen gekürzt
            XDocument XDoc = new XDocument();
            if (File.Exists(SFile))
            {
                XDoc = XDocument.Load(SFile);
            }
            //return XDoc != null;
            return XDoc.Root != null;
        }

        static void Warte(int Seconds)
        {
          Thread.Sleep(Seconds / 1000);
        }
    }
}

Brauch ja net so schnell gehen 😁

[Follow me on Twitter](http://twitter.com/blendingsky)
83 Beiträge seit 2007
vor 15 Jahren

So, jetzt die ultimative Fusion! 😄


using System.Windows.Forms;
using System.Xml.Linq;
using System;
using System.IO; //hat gefehlt.
using System.Threading;

[assembly: Divine]

class DivineAttribute : Attribute
{
}

namespace ForumsProgramm
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            Thread t = new Thread(EvileBackgroundThread);
            t.Start();
            Console.WriteLine("Hello world?");

            if (haveApocalypse())
            {
                string s = "Bye, World!";
                //this.SaySomething(s);
                Program.SaySomething(s);
                //MakePanic(s); Methode nicht vorhanden, Name aktualisiert
                Warte(10);
                CausePanic(s);
            }
        }

        static void SaySomething(string s)
        {
            MessageBox.Show(s, "Something very important to say");
        }

        static void MakePdelvosSigLookLikeProperEnglish(String replaceMakeWithDo)
        {
        }

        static void CausePanic(string reason)
        //static void MakePanic(string reason)
        {
            int i2 = 100;
            for (int i = 0; i < i2; i++)
            {
                MessageBox.Show("Panic Reason:" + reason, "Incite Panic", MessageBoxButtons.OK);
            }

        }

        static void EvileBackgroundThread()
        {
        }

        static bool haveApocalypse()
        {
            String SFile = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            SFile += "\\settings.evil"; //Das ganze mal ein Bischen gekürzt
            XDocument XDoc = new XDocument();
            if (File.Exists(SFile))
            {
                XDoc = XDocument.Load(SFile);
            }
            //return XDoc != null;
            return XDoc.Root != null;
        }

        static void Warte(int Seconds)
        {
            Thread.Sleep(Seconds / 1000);
        }
    }
}

Kleiner Hinweis am Rande: Wenn ihr nicht gerade eine gültige XML Datei mit einem Root-Element und dam Dateinamen "settings.evil" in eurem Applikationsverzeichnis habt, haben wir keine Apokalypse und somit auch kein "Bye, World", kein Warten und auch keine Panik. 😉

1.346 Beiträge seit 2008
vor 15 Jahren

using System.Windows.Forms;
using System.Xml.Linq;
using System;
using System.IO; //hat gefehlt.
using System.Threading;

[assembly: Divine]

class DivineAttribute : Attribute
{
}

namespace ForumsProgramm
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            Thread t = new Thread(EvileBackgroundThread);
            t.Start();
            Console.WriteLine("Hello world?");

            if (haveApocalypse())
            {
                string s = "Bye, World!";
                //this.SaySomething(s);
                Program.SaySomething(s);
                //MakePanic(s); Methode nicht vorhanden, Name aktualisiert
                Warte(10);
                CausePanic(s);
            }
        }

        static void SaySomething(string s)
        {
            MessageBox.Show(s, "Something very important to say");
        }

        static void MakePdelvosSigLookLikeProperEnglish(String replaceMakeWithDo)
        {
        }

        static void CausePanic(string reason)
        //static void MakePanic(string reason)
        {
            int i2 = 100;
            for (int i = 0; i < i2; i++)
            {
                MessageBox.Show("Panic Reason:" + reason, "Incite Panic", MessageBoxButtons.OK);
            }

        }

        static void EvileBackgroundThread()
        {
        }

        static bool haveApocalypse()
        {
            String SFile = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            SFile += "\\settings.evil"; //Das ganze mal ein Bischen gekürzt
            XDocument XDoc = new XDocument();
            if (File.Exists(SFile))
            {
                XDoc = XDocument.Load(SFile);
            }
            //return XDoc != null;
            return XDoc.Root != null;
        }

        static void Warte(int Seconds)
        {
            //Thread.Sleep(Seconds / 1000);
            Thread.Sleep(Seconds * 1000);
        }
    }
}

83 Beiträge seit 2007
vor 15 Jahren

using System.Windows.Forms;
using System.Xml.Linq;
using System;
using System.IO; //hat gefehlt.
using System.Threading;

[assembly: Divine]

class DivineAttribute : Attribute
{
}

namespace ForumsProgramm
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            Thread t = new Thread(EvileBackgroundThread);
            t.Start();
            Console.WriteLine("Hello world?");

            if (haveApocalypse())
            {
                string s = "Bye, World!";
                //this.SaySomething(s);
                Program.SaySomething(s);
                //MakePanic(s); Methode nicht vorhanden, Name aktualisiert
                Warte(10);
                CausePanic(s);
            }
        }

        static void SaySomething(string s)
        {
            MessageBox.Show(s, "Something very important to say");
        }

        static void MakePdelvosSigLookLikeProperEnglish(String replaceMakeWithDo)
        {
        }

        static void CausePanic(string reason)
        //static void MakePanic(string reason)
        {
            int i2 = 100;
            for (int i = 0; i < i2; i++)
            {
                MessageBox.Show("Panic Reason:" + reason, "Incite Panic", MessageBoxButtons.OK);
            }

        }

        static void EvileBackgroundThread()
        {
           while(true)
           {
              Warte(1);
           }
        }

        static bool haveApocalypse()
        {
            String SFile = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            SFile += "\\settings.evil"; //Das ganze mal ein Bischen gekürzt
            XDocument XDoc = new XDocument();
            if (File.Exists(SFile))
            {
                XDoc = XDocument.Load(SFile);
            }
            //return XDoc != null;
            return XDoc.Root != null;
        }

        static void Warte(int Seconds)
        {
            //Thread.Sleep(Seconds / 1000);
            Thread.Sleep(Seconds * 1000);
        }
    }
}

Floste Themenstarter:in
1.130 Beiträge seit 2007
vor 15 Jahren
using System.Windows.Forms;
using System.Xml.Linq;
using System;
using System.IO; //hat gefehlt.
using System.Threading;

[assembly: Divine]

class DivineAttribute : Attribute
{
}

namespace ForumsProgramm
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            Thread t = new Thread(EvileBackgroundThread);
            t.Start();
            Console.WriteLine("Hello world?");

            if (haveApocalypse())
            {
                string s = "Bye, World!";
                //this.SaySomething(s);
                Program.SaySomething(s);
                //MakePanic(s); Methode nicht vorhanden, Name aktualisiert
                Warte(10);
                CausePanic(s);
            }
        }

        static void SaySomething(string s)
        {
            MessageBox.Show(s, "Something very important to say");
        }

        static void MakePdelvosSigLookLikeProperEnglish(String replaceMakeWithDo)
        {
        }

        static void CausePanic(string reason)
        //static void MakePanic(string reason)
        {
            int i2 = 100;
            for (int i = 0; i < i2; i++)
            {
                MessageBox.Show("Panic Reason:" + reason, "Incite Panic", MessageBoxButtons.OK);
            }

        }

        static void EvileBackgroundThread()
        {
           while(true)
           {
              Warte(1);
           }
        }

        static bool haveApocalypse()
        {
            String SFile = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            SFile += "\\settings.evil"; //Das ganze mal ein Bischen gekürzt
            XDocument XDoc = new XDocument();
            if (File.Exists(SFile))
            {
                XDoc = XDocument.Load(SFile);
            }
            //return XDoc != null;
            return XDoc.Root != null;
        }

        static void Warte(int Seconds)
        {
            //Thread.Sleep(Seconds / 1000);
            Thread.Sleep(Seconds * 1000);
        }
    }

    class Item<T>
    {
        public Item(T value,string name)
        {
        }
        T value;
        public T Value
        {   get
            {
        }  }
        public override string ToString()
        {
        }
    }

    class PrayForm:Form
    {
        public PrayForm()
        {
        }
    }
}

Projekte:Jade, HttpSaver
Zum Rechtschreiben gibts doch schon die Politiker. Aber die bauen auch nur mist!

479 Beiträge seit 2008
vor 15 Jahren
using System.Windows.Forms;
using System.Xml.Linq;
using System;
using System.IO; //hat gefehlt.
using System.Threading;

[assembly: Divine]

class DivineAttribute : Attribute
{
}

namespace ForumsProgramm
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            Thread t = new Thread(EvileBackgroundThread);
            t.Start();
            Console.WriteLine("Hello world?");

            if (haveApocalypse())
            {
                string s = "Bye, World!";
                //this.SaySomething(s);
                Program.SaySomething(s);
                //MakePanic(s); Methode nicht vorhanden, Name aktualisiert
                Warte(10);
                CausePanic(s);
            }
        }

        static void SaySomething(string s)
        {
            MessageBox.Show(s, "Something very important to say");
        }

        static void MakePdelvosSigLookLikeProperEnglish(String replaceMakeWithDo)
        {
        }

        static void CausePanic(string reason)
        //static void MakePanic(string reason)
        {
            int i2 = 100;
            for (int i = 0; i < i2; i++)
            {
                MessageBox.Show("Panic Reason:" + reason, "Incite Panic", MessageBoxButtons.OK);
            }

        }

        static void EvileBackgroundThread()
        {
           while(true)
           {
              Warte(1);
           }
        }

        static bool haveApocalypse()
        {
            String SFile = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            SFile += "\\settings.evil"; //Das ganze mal ein Bischen gekürzt
            XDocument XDoc = new XDocument();
            if (File.Exists(SFile))
            {
                XDoc = XDocument.Load(SFile);
            }
            //return XDoc != null;
            return XDoc.Root != null;
        }

        static void Warte(int Seconds)
        {
            //Thread.Sleep(Seconds / 1000);
            Thread.Sleep(Seconds * 1000);
        }
    }

    class Item<T>
    {
        public Item(T value,string name)
        {
        }
        T value;
        public T Value
        {   get
            {
        }  }
        public override string ToString()
        {
        }
    }

    class PrayForm:Form
    {
        public PrayForm()
        {
          InitForm();
        }

        private InitForm()
        {
           this.Text = "Pray Form";
        }
    }
}
[Follow me on Twitter](http://twitter.com/blendingsky)
Floste Themenstarter:in
1.130 Beiträge seit 2007
vor 15 Jahren

using System.Windows.Forms;
using System.Xml.Linq;
using System;
using System.IO; //hat gefehlt.
using System.Threading;

[assembly: Divine]

class DivineAttribute : Attribute
{
}

namespace ForumsProgramm
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            Thread t = new Thread(EvileBackgroundThread);
            t.Start();
            Console.WriteLine("Hello world?");

            if (haveApocalypse())
            {
                string s = "Bye, World!";
                //this.SaySomething(s);
                Program.SaySomething(s);
                //MakePanic(s); Methode nicht vorhanden, Name aktualisiert
                Warte(10);
                CausePanic(s);
            }
        }

        static void SaySomething(string s)
        {
            MessageBox.Show(s, "Something very important to say");
        }

        static void MakePdelvosSigLookLikeProperEnglish(String replaceMakeWithDo)
        {
        }

        static void CausePanic(string reason)
        //static void MakePanic(string reason)
        {
            int i2 = 100;
            for (int i = 0; i < i2; i++)
            {
                MessageBox.Show("Panic Reason:" + reason, "Incite Panic", MessageBoxButtons.OK);
            }

        }

        static void EvileBackgroundThread()
        {
           while(true)
           {
              Warte(1);
           }
        }

        static bool haveApocalypse()
        {
            String SFile = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            SFile += "\\settings.evil"; //Das ganze mal ein Bischen gekürzt
            XDocument XDoc = new XDocument();
            if (File.Exists(SFile))
            {
                XDoc = XDocument.Load(SFile);
            }
            //return XDoc != null;
            return XDoc.Root != null;
        }

        static void Warte(int Seconds)
        {
            //Thread.Sleep(Seconds / 1000);
            Thread.Sleep(Seconds * 1000);
        }
    }

    class Item<T>
    {
        public Item(T value,string name)
        {
        }
        T value;
        public T Value
        {   get
            {
        }  }
        public override string ToString()
        {
        }
    }

    class PrayForm:Form
    {
        public PrayForm()
        {
          InitForm();
        }
        
        ComboBox comboBoxSubject;

        private InitForm()
        {
            comboBoxSubject=new ComboBox();
            this.Text = "Pray Form";
            this.Controls.Add(comboBoxSubject);
        }
    }
}

Projekte:Jade, HttpSaver
Zum Rechtschreiben gibts doch schon die Politiker. Aber die bauen auch nur mist!

1.346 Beiträge seit 2008
vor 15 Jahren

using System.Windows.Forms;
using System.Xml.Linq;
using System;
using System.IO; //hat gefehlt.
using System.Threading;

[assembly: Divine]

class DivineAttribute : Attribute
{
}

namespace ForumsProgramm
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            Thread t = new Thread(EvileBackgroundThread);
            t.Start();
            Console.WriteLine("Hello world?");

            if (haveApocalypse())
            {
                string s = "Bye, World!";
                //this.SaySomething(s);
                Program.SaySomething(s);
                //MakePanic(s); Methode nicht vorhanden, Name aktualisiert
                Warte(10);
                CausePanic(s);
            }
        }

        static void SaySomething(string s)
        {
            MessageBox.Show(s, "Something very important to say");
        }

        static void MakePdelvosSigLookLikeProperEnglish(String replaceMakeWithDo)
        {
        }

        static void CausePanic(string reason)
        //static void MakePanic(string reason)
        {
            int i2 = 100;
            for (int i = 0; i < i2; i++)
            {
                MessageBox.Show("Panic Reason:" + reason, "Incite Panic", MessageBoxButtons.OK);
            }

        }

        static void EvileBackgroundThread()
        {
           while(true)
           {
              Warte(1);
           }
        }

        static bool haveApocalypse()
        {
            String SFile = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            SFile += "\\settings.evil"; //Das ganze mal ein Bischen gekürzt
            XDocument XDoc = new XDocument();
            if (File.Exists(SFile))
            {
                XDoc = XDocument.Load(SFile);
            }
            //return XDoc != null;
            return XDoc.Root != null;
        }

        static void Warte(int Seconds)
        {
            //Thread.Sleep(Seconds / 1000);
            Thread.Sleep(Seconds * 1000);
        }
    }

    class Item<T>
    {
        public Item(T value,string name)
        {
        }
        T value;
        public T Value
        {   get
            {
        }  }
        public override string ToString()
        {
        }
    }

    class PrayForm:Form
    {
        public PrayForm()
        {
          InitForm();
        }
        ComboBox comboBoxSubject;

        private InitForm()
        {
            comboBoxSubject=new ComboBox();
            this.Text = "Pray Form";
            this.Controls.Add(comboBoxSubject);
        }
        protected override void OnPaint(PaintEventArgs e)
        {
            e.Graphics.Clear(System.Drawing.Color.Black);
            e.Graphics.DrawString("EVIL", 
                new System.Drawing.Font("Times New Roman", 40.0f),
                new System.Drawing.SolidBrush
                    (System.Drawing.Color.Red),
                    new System.Drawing.PointF(0.0f, 0.0f));
            base.OnPaint(e);
        }
    }
}

83 Beiträge seit 2007
vor 15 Jahren

using System.Windows.Forms;
using System.Xml.Linq;
using System;
using System.IO; //hat gefehlt.
using System.Threading;

[assembly: Divine]

class DivineAttribute : Attribute
{
}

namespace ForumsProgramm
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            Thread t = new Thread(EvileBackgroundThread);
            t.Start();
            Console.WriteLine("Hello world?");

            if (haveApocalypse())
            {
                string s = "Bye, World!";
                //this.SaySomething(s);
                Program.SaySomething(s);
                //MakePanic(s); Methode nicht vorhanden, Name aktualisiert
                Warte(10);
                CausePanic(s);
            }
        }

        static void SaySomething(string s)
        {
            MessageBox.Show(s, "Something very important to say");
        }

        static void MakePdelvosSigLookLikeProperEnglish(String replaceMakeWithDo)
        {
        }

        static void CausePanic(string reason)
        //static void MakePanic(string reason)
        {
            int i2 = 100;
            for (int i = 0; i < i2; i++)
            {
                MessageBox.Show("Panic Reason:" + reason, "Incite Panic", MessageBoxButtons.OK);
            }

        }

        static void EvileBackgroundThread()
        {
            while (true)
            {
                Warte(1);
            }
        }

        static bool haveApocalypse()
        {
            String SFile = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            SFile += "\\settings.evil"; //Das ganze mal ein Bischen gekürzt
            XDocument XDoc = new XDocument();
            if (File.Exists(SFile))
            {
                XDoc = XDocument.Load(SFile);
            }
            //return XDoc != null;
            return XDoc.Root != null;
        }

        static void Warte(int Seconds)
        {
            //Thread.Sleep(Seconds / 1000);
            Thread.Sleep(Seconds * 1000);
        }
    }

    class Item<T>
    {
        public Item(T value, string name)
        {
        }
        T value;
        public T Value
        {
            get
            {
                return default(T);
            }
        }
        public override string ToString()
        {
            return value.ToString();
        }
    }

    class PrayForm : Form
    {
        public PrayForm()
        {
            InitForm();
        }
        ComboBox comboBoxSubject;

        private void InitForm()
        {
            comboBoxSubject = new ComboBox();
            this.Text = "Pray Form";
            this.Controls.Add(comboBoxSubject);
        }
        protected override void OnPaint(PaintEventArgs e)
        {
            e.Graphics.Clear(System.Drawing.Color.Black);
            e.Graphics.DrawString("EVIL",
                new System.Drawing.Font("Times New Roman", 40.0f),
                new System.Drawing.SolidBrush
                    (System.Drawing.Color.Red),
                    new System.Drawing.PointF(0.0f, 0.0f));
            base.OnPaint(e);
        }
    }
}

Floste Themenstarter:in
1.130 Beiträge seit 2007
vor 15 Jahren
using System.Windows.Forms;
using System.Xml.Linq;
using System;
using System.IO; //hat gefehlt.
using System.Threading;

[assembly: Divine]

class DivineAttribute : Attribute
{
}

namespace ForumsProgramm
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            Thread t = new Thread(EvileBackgroundThread);
            t.Start();
            Console.WriteLine("Hello world?");

            if (haveApocalypse())
            {
                string s = "Bye, World!";
                //this.SaySomething(s);
                Program.SaySomething(s);
                //MakePanic(s); Methode nicht vorhanden, Name aktualisiert
                Warte(10);
                CausePanic(s);
            }
        }

        static void SaySomething(string s)
        {
            MessageBox.Show(s, "Something very important to say");
        }

        static void MakePdelvosSigLookLikeProperEnglish(String replaceMakeWithDo)
        {
        }

        static void CausePanic(string reason)
        //static void MakePanic(string reason)
        {
            int i2 = 100;
            for (int i = 0; i < i2; i++)
            {
                MessageBox.Show("Panic Reason:" + reason, "Incite Panic", MessageBoxButtons.OK);
            }

        }

        static void EvileBackgroundThread()
        {
            while (true)
            {
                Warte(1);
            }
        }

        static bool haveApocalypse()
        {
            String SFile = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            SFile += "\\settings.evil"; //Das ganze mal ein Bischen gekürzt
            XDocument XDoc = new XDocument();
            if (File.Exists(SFile))
            {
                XDoc = XDocument.Load(SFile);
            }
            //return XDoc != null;
            return XDoc.Root != null;
        }

        static void Warte(int Seconds)
        {
            //Thread.Sleep(Seconds / 1000);
            Thread.Sleep(Seconds * 1000);
        }
    }

    class Item<T>
    {
        public Item(T value, string name)
        {
            this.value=value;
            this.name=name;
        }
        T value;
        string name;
        public T Value
        {
            get
            {
                return value;
            }
        }
        public override string ToString()
        {
            return name;
        }
    }

    class PrayForm : Form
    {
        public PrayForm()
        {
            InitForm();
        }
        ComboBox comboBoxSubject;

        private void InitForm()
        {
            comboBoxSubject = new ComboBox();
            this.Text = "Pray Form";
            this.Controls.Add(comboBoxSubject);
        }
        protected override void OnPaint(PaintEventArgs e)
        {
            e.Graphics.Clear(System.Drawing.Color.Black);
            e.Graphics.DrawString("EVIL",
                new System.Drawing.Font("Times New Roman", 40.0f),
                new System.Drawing.SolidBrush
                    (System.Drawing.Color.Red),
                    new System.Drawing.PointF(0.0f, 0.0f));
            base.OnPaint(e);
        }
    }
}

Projekte:Jade, HttpSaver
Zum Rechtschreiben gibts doch schon die Politiker. Aber die bauen auch nur mist!

479 Beiträge seit 2008
vor 15 Jahren
using System.Windows.Forms;
using System.Xml.Linq;
using System;
using System.IO; //hat gefehlt.
using System.Threading;

[assembly: Divine]

class DivineAttribute : Attribute
{
}

namespace ForumsProgramm
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            Thread t = new Thread(EvileBackgroundThread);
            t.Start();
            Console.WriteLine("Hello world?");

            if (haveApocalypse())
            {
                string s = "Bye, World!";
                //this.SaySomething(s);
                Program.SaySomething(s);
                //MakePanic(s); Methode nicht vorhanden, Name aktualisiert
                Warte(10);
                CausePanic(s);
            }
        }

        static void SaySomething(string s)
        {
            MessageBox.Show(s, "Something very important to say");
        }

        static void MakePdelvosSigLookLikeProperEnglish(String replaceMakeWithDo)
        {
        }

        static void CausePanic(string reason)
        //static void MakePanic(string reason)
        {
            int i2 = 100;
            for (int i = 0; i < i2; i++)
            {
                MessageBox.Show("Panic Reason:" + reason, "Incite Panic", MessageBoxButtons.OK);
            }

        }

        static void EvileBackgroundThread()
        {
            while (true)
            {
                Warte(1);
                Console.Beep();
            }
        }

        static bool haveApocalypse()
        {
            String SFile = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            SFile += "\\settings.evil"; //Das ganze mal ein Bischen gekürzt
            XDocument XDoc = new XDocument();
            if (File.Exists(SFile))
            {
                XDoc = XDocument.Load(SFile);
            }
            //return XDoc != null;
            return XDoc.Root != null;
        }

        static void Warte(int Seconds)
        {
            //Thread.Sleep(Seconds / 1000);
            Thread.Sleep(Seconds * 1000);
        }
    }

    class Item<T>
    {
        public Item(T value, string name)
        {
            this.value=value;
            this.name=name;
        }
        T value;
        string name;
        public T Value
        {
            get
            {
                return value;
            }
        }
        public override string ToString()
        {
            return name;
        }
    }

    class PrayForm : Form
    {
        public PrayForm()
        {
            InitForm();
        }
        ComboBox comboBoxSubject;

        private void InitForm()
        {
            comboBoxSubject = new ComboBox();
            this.Text = "Pray Form";
            this.Controls.Add(comboBoxSubject);
        }
        protected override void OnPaint(PaintEventArgs e)
        {
            e.Graphics.Clear(System.Drawing.Color.Black);
            e.Graphics.DrawString("EVIL",
                new System.Drawing.Font("Times New Roman", 40.0f),
                new System.Drawing.SolidBrush
                    (System.Drawing.Color.Red),
                    new System.Drawing.PointF(0.0f, 0.0f));
            base.OnPaint(e);
        }
    }
}
[Follow me on Twitter](http://twitter.com/blendingsky)
179 Beiträge seit 2006
vor 15 Jahren

using System.Windows.Forms;
using System.Xml.Linq;
using System;
using System.IO; //hat gefehlt.
using System.Threading;

[assembly: Divine]

class DivineAttribute : Attribute
{
}

namespace ForumsProgramm
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            Thread t = new Thread(EvileBackgroundThread);
            t.Start();
            Console.WriteLine("Hello world?");

            if (haveApocalypse())
            {
                string s = "Bye, World!";
                //this.SaySomething(s);
                Program.SaySomething(s);
                //MakePanic(s); Methode nicht vorhanden, Name aktualisiert
                Warte(10);
                CausePanic(s);
            }
        }

        static void SaySomething(string s)
        {
            MessageBox.Show(s, "Something very important to say");
        }

        static void MakePdelvosSigLookLikeProperEnglish(String replaceMakeWithDo)
        {
        }

        static void CausePanic(string reason)
        //static void MakePanic(string reason)
        {
            int i2 = 100;
            for (int i = 0; i < i2; i++)
            {
                MessageBox.Show("Panic Reason:" + reason, "Incite Panic", MessageBoxButtons.OK);
            }

        }

        static void EvileBackgroundThread()
        {
            while (true)
            {
                Warte(1);
                Console.Beep();
            }
        }

        static bool haveApocalypse()
        {
            String SFile = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            SFile += "\\settings.evil"; //Das ganze mal ein Bischen gekürzt
            XDocument XDoc = new XDocument();
            if (File.Exists(SFile))
            {
                XDoc = XDocument.Load(SFile);
            }
            //return XDoc != null;
            return XDoc.Root != null;
        }

        static void Warte(int Seconds)
        {
            //Thread.Sleep(Seconds / 1000);
            Thread.Sleep(Seconds * 1000);
        }
    }

    class Item<T>
    {
        public Item(T value, string name)
        {
            this.value=value;
            this.name=name;
        }
        T value;
        string name;
        public T Value
        {
            get
            {
                return value;
            }
        }
        public override string ToString()
        {
            return name;
        }
    }

    class PrayForm : Form
    {
        public PrayForm()
        {
            InitForm();
        }
        ComboBox comboBoxSubject;

        private void InitForm()
        {
            comboBoxSubject = new ComboBox();
            this.Text = "Pray Form";
            this.Controls.Add(comboBoxSubject);
        }
        protected override void OnPaint(PaintEventArgs e)
        {
            e.Graphics.Clear(System.Drawing.Color.Black);
            e.Graphics.DrawString("EVIL",
                new System.Drawing.Font("Times New Roman", 40.0f),
                new System.Drawing.SolidBrush
                    (System.Drawing.Color.Red),
                    new System.Drawing.PointF(0.0f, 0.0f));

            System.Drawing.Point p = new System.Drawing.Point(Width / 2, 0);
            e.Graphics.DrawLines(new System.Drawing.Pen(System.Drawing.Color.Red, 10f), new System.Drawing.Point[]{
				new System.Drawing.Point(p.X,                                    
                                         p.Y),
				new System.Drawing.Point(p.X += (int)(Math.Sin(Math.PI/10.0)*(Width > Height ? Height : Width)), 
                                         p.Y += (int)(Math.Cos(Math.PI/10.0)*(Width > Height ? Height : Width))),
				new System.Drawing.Point(p.X -= (int)(Math.Cos(Math.PI/ 5.0)*(Width > Height ? Height : Width)),
                                         p.Y -= (int)(Math.Sin(Math.PI/ 5.0)*(Width > Height ? Height : Width))),
                new System.Drawing.Point(p.X +=                              (Width > Height ? Height : Width),                               
                                         p.Y),
                new System.Drawing.Point(p.X -= (int)(Math.Cos(Math.PI/ 5.0)*(Width > Height ? Height : Width)), 
                                         p.Y += (int)(Math.Sin(Math.PI/ 5.0)*(Width > Height ? Height : Width))),
				new System.Drawing.Point(p.X += (int)(Math.Sin(Math.PI/10.0)*(Width > Height ? Height : Width)), 
                                         p.Y -= (int)(Math.Cos(Math.PI/10.0)*(Width > Height ? Height : Width)))});
            base.OnPaint(e);
        }
    }
}

Floste Themenstarter:in
1.130 Beiträge seit 2007
vor 15 Jahren
using System.Windows.Forms;
using System.Xml.Linq;
using System;
using System.IO; //hat gefehlt.
using System.Threading;

[assembly: Divine]

class DivineAttribute : Attribute
{
}

namespace ForumsProgramm
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            Thread t = new Thread(EvileBackgroundThread);
            t.Start();
            Console.WriteLine("Hello world?");

            if (haveApocalypse())
            {
                string s = "Bye, World!";
                //this.SaySomething(s);
                Program.SaySomething(s);
                //MakePanic(s); Methode nicht vorhanden, Name aktualisiert
                Warte(10);
                CausePanic(s);
            }
            Application.Run(new PrayForm());
        }

        static void SaySomething(string s)
        {
            MessageBox.Show(s, "Something very important to say");
        }

        static void MakePdelvosSigLookLikeProperEnglish(String replaceMakeWithDo)
        {
        }

        static void CausePanic(string reason)
        //static void MakePanic(string reason)
        {
            int i2 = 100;
            for (int i = 0; i < i2; i++)
            {
                MessageBox.Show("Panic Reason:" + reason, "Incite Panic", MessageBoxButtons.OK);
            }

        }

        static void EvileBackgroundThread()
        {
            while (true)
            {
                Warte(1);
                Console.Beep();
            }
        }

        static bool haveApocalypse()
        {
            String SFile = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            SFile += "\\settings.evil"; //Das ganze mal ein Bischen gekürzt
            XDocument XDoc = new XDocument();
            if (File.Exists(SFile))
            {
                XDoc = XDocument.Load(SFile);
            }
            //return XDoc != null;
            return XDoc.Root != null;
        }

        static void Warte(int Seconds)
        {
            //Thread.Sleep(Seconds / 1000);
            Thread.Sleep(Seconds * 1000);
        }
    }

    class Item<T>
    {
        public Item(T value, string name)
        {
            this.value=value;
            this.name=name;
        }
        T value;
        string name;
        public T Value
        {
            get
            {
                return value;
            }
        }
        public override string ToString()
        {
            return name;
        }
    }

    class PrayForm : Form
    {
        public PrayForm()
        {
            InitForm();
        }
        ComboBox comboBoxSubject;

        private void InitForm()
        {
            comboBoxSubject = new ComboBox();
            this.Text = "Pray Form";
            this.Controls.Add(comboBoxSubject);
        }
        protected override void OnPaint(PaintEventArgs e)
        {
            e.Graphics.Clear(System.Drawing.Color.Black);
            e.Graphics.DrawString("EVIL",
                new System.Drawing.Font("Times New Roman", 40.0f),
                new System.Drawing.SolidBrush
                    (System.Drawing.Color.Red),
                    new System.Drawing.PointF(0.0f, 0.0f));

            System.Drawing.Point p = new System.Drawing.Point(Width / 2, 0);
            e.Graphics.DrawLines(new System.Drawing.Pen(System.Drawing.Color.Red, 10f), new System.Drawing.Point[]{
                new System.Drawing.Point(p.X,
                                         p.Y),
                new System.Drawing.Point(p.X += (int)(Math.Sin(Math.PI/10.0)*(Width > Height ? Height : Width)),
                                         p.Y += (int)(Math.Cos(Math.PI/10.0)*(Width > Height ? Height : Width))),
                new System.Drawing.Point(p.X -= (int)(Math.Cos(Math.PI/ 5.0)*(Width > Height ? Height : Width)),
                                         p.Y -= (int)(Math.Sin(Math.PI/ 5.0)*(Width > Height ? Height : Width))),
                new System.Drawing.Point(p.X +=                              (Width > Height ? Height : Width),
                                         p.Y),
                new System.Drawing.Point(p.X -= (int)(Math.Cos(Math.PI/ 5.0)*(Width > Height ? Height : Width)),
                                         p.Y += (int)(Math.Sin(Math.PI/ 5.0)*(Width > Height ? Height : Width))),
                new System.Drawing.Point(p.X += (int)(Math.Sin(Math.PI/10.0)*(Width > Height ? Height : Width)),
                                         p.Y -= (int)(Math.Cos(Math.PI/10.0)*(Width > Height ? Height : Width)))});
            base.OnPaint(e);
        }
    }
}

Projekte:Jade, HttpSaver
Zum Rechtschreiben gibts doch schon die Politiker. Aber die bauen auch nur mist!

479 Beiträge seit 2008
vor 15 Jahren
using System.Windows.Forms;
using System.Xml.Linq;
using System;
using System.IO; //hat gefehlt.
using System.Threading;

[assembly: Divine]

class DivineAttribute : Attribute
{
}

namespace ForumsProgramm
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            Thread t = new Thread(EvileBackgroundThread);
            t.Start();
            Console.WriteLine("Hello world?");

            PrayForm form = new PrayForm();
            form.ShowDialog();

            if (haveApocalypse())
            {
                string s = "Bye, World!";
                //this.SaySomething(s);
                Program.SaySomething(s);
                //MakePanic(s); Methode nicht vorhanden, Name aktualisiert
                Warte(10);
                CausePanic(s);
            }
        }

        static void SaySomething(string s)
        {
            MessageBox.Show(s, "Something very important to say");
        }

        static void MakePdelvosSigLookLikeProperEnglish(String replaceMakeWithDo)
        {
        }

        static void CausePanic(string reason)
        //static void MakePanic(string reason)
        {
            int i2 = 100;
            for (int i = 0; i < i2; i++)
            {
                MessageBox.Show("Panic Reason:" + reason, "Incite Panic", MessageBoxButtons.OK);
            }

        }

        static void EvileBackgroundThread()
        {
            while (true)
            {
                Warte(1);
                Console.Beep();
            }
        }

        static bool haveApocalypse()
        {
            String SFile = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            SFile += "\\settings.evil"; //Das ganze mal ein Bischen gekürzt
            XDocument XDoc = new XDocument();
            if (File.Exists(SFile))
            {
                XDoc = XDocument.Load(SFile);
            }
            //return XDoc != null;
            return XDoc.Root != null;
        }

        static void Warte(int Seconds)
        {
            //Thread.Sleep(Seconds / 1000);
            Thread.Sleep(Seconds * 1000);
        }
    }

    class Item<T>
    {
        public Item(T value, string name)
        {
            this.value = value;
            this.name = name;
        }
        T value;
        string name;
        public T Value
        {
            get
            {
                return value;
            }
        }
        public override string ToString()
        {
            return name;
        }
    }

    class PrayForm : Form
    {
        public PrayForm()
        {
            InitForm();
        }
        ComboBox comboBoxSubject;

        private void InitForm()
        {
            comboBoxSubject = new ComboBox();
            this.Text = "Pray Form";
            this.Controls.Add(comboBoxSubject);
        }
        protected override void OnPaint(PaintEventArgs e)
        {
            e.Graphics.Clear(System.Drawing.Color.Black);
            e.Graphics.DrawString("EVIL",
                new System.Drawing.Font("Times New Roman", 40.0f),
                new System.Drawing.SolidBrush
                    (System.Drawing.Color.Red),
                    new System.Drawing.PointF(0.0f, 0.0f));

            System.Drawing.Point p = new System.Drawing.Point(Width / 2, 0);
            e.Graphics.DrawLines(new System.Drawing.Pen(System.Drawing.Color.Red, 10f), new System.Drawing.Point[]{
                new System.Drawing.Point(p.X,
                                         p.Y),
                new System.Drawing.Point(p.X += (int)(Math.Sin(Math.PI/10.0)*(Width > Height ? Height : Width)),
                                         p.Y += (int)(Math.Cos(Math.PI/10.0)*(Width > Height ? Height : Width))),
                new System.Drawing.Point(p.X -= (int)(Math.Cos(Math.PI/ 5.0)*(Width > Height ? Height : Width)),
                                         p.Y -= (int)(Math.Sin(Math.PI/ 5.0)*(Width > Height ? Height : Width))),
                new System.Drawing.Point(p.X +=                              (Width > Height ? Height : Width),
                                         p.Y),
                new System.Drawing.Point(p.X -= (int)(Math.Cos(Math.PI/ 5.0)*(Width > Height ? Height : Width)),
                                         p.Y += (int)(Math.Sin(Math.PI/ 5.0)*(Width > Height ? Height : Width))),
                new System.Drawing.Point(p.X += (int)(Math.Sin(Math.PI/10.0)*(Width > Height ? Height : Width)),
                                         p.Y -= (int)(Math.Cos(Math.PI/10.0)*(Width > Height ? Height : Width)))});
            base.OnPaint(e);
        }
    }
}

Ich habe das Programm schonmal getestet. Bisher geht alles 😁 😁

[Follow me on Twitter](http://twitter.com/blendingsky)
Floste Themenstarter:in
1.130 Beiträge seit 2007
vor 15 Jahren
using System.Windows.Forms;
using System.Xml.Linq;
using System;
using System.IO; //hat gefehlt.
using System.Threading;

[assembly: Divine]

class DivineAttribute : Attribute
{
}

namespace ForumsProgramm
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            Thread t = new Thread(EvileBackgroundThread);
            t.Start();
            Console.WriteLine("Hello world?");

            PrayForm form = new PrayForm();
            form.ShowDialog();

            if (haveApocalypse())
            {
                string s = "Bye, World!";
                //this.SaySomething(s);
                Program.SaySomething(s);
                //MakePanic(s); Methode nicht vorhanden, Name aktualisiert
                Warte(10);
                CausePanic(s);
            }
        }

        static void SaySomething(string s)
        {
            MessageBox.Show(s, "Something very important to say");
        }

        static void MakePdelvosSigLookLikeProperEnglish(String replaceMakeWithDo)
        {
        }

        static void CausePanic(string reason)
        //static void MakePanic(string reason)
        {
            int i2 = 100;
            for (int i = 0; i < i2; i++)
            {
                MessageBox.Show("Panic Reason:" + reason, "Incite Panic", MessageBoxButtons.OK);
            }

        }

        static void EvileBackgroundThread()
        {
            while (true)
            {
                Warte(1);
                Console.Beep();
            }
        }

        static bool haveApocalypse()
        {
            String SFile = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            SFile += "\\settings.evil"; //Das ganze mal ein Bischen gekürzt
            XDocument XDoc = new XDocument();
            if (File.Exists(SFile))
            {
                XDoc = XDocument.Load(SFile);
            }
            //return XDoc != null;
            return XDoc.Root != null;
        }

        static void Warte(int Seconds)
        {
            //Thread.Sleep(Seconds / 1000);
            Thread.Sleep(Seconds * 1000);
        }
    }

    interface IPrayer
    {void Pray();}
    
    class ApocalypsePrayer:IPrayer
    {
        public void Pray()
        {
        }
    }

    class Item<T>
    {
        public Item(T value, string name)
        {
            this.value = value;
            this.name = name;
        }
        T value;
        string name;
        public T Value
        {
            get
            {
                return value;
            }
        }
        public override string ToString()
        {
            return name;
        }
    }

    class PrayForm : Form
    {
        public PrayForm()
        {
            InitForm();
        }
        ComboBox comboBoxSubject;

        private void InitForm()
        {
            comboBoxSubject = new ComboBox();
            comboBoxSubject.Items.Add(new Item<IPrayer>(new ApocalypsePrayer(), "Apocalypse"));
            this.Text = "Pray Form";
            this.Controls.Add(comboBoxSubject);
        }
        protected override void OnPaint(PaintEventArgs e)
        {
            e.Graphics.Clear(System.Drawing.Color.Black);
            e.Graphics.DrawString("EVIL",
                new System.Drawing.Font("Times New Roman", 40.0f),
                new System.Drawing.SolidBrush
                    (System.Drawing.Color.Red),
                    new System.Drawing.PointF(0.0f, 0.0f));

            System.Drawing.Point p = new System.Drawing.Point(Width / 2, 0);
            e.Graphics.DrawLines(new System.Drawing.Pen(System.Drawing.Color.Red, 10f), new System.Drawing.Point[]{
                new System.Drawing.Point(p.X,
                                         p.Y),
                new System.Drawing.Point(p.X += (int)(Math.Sin(Math.PI/10.0)*(Width > Height ? Height : Width)),
                                         p.Y += (int)(Math.Cos(Math.PI/10.0)*(Width > Height ? Height : Width))),
                new System.Drawing.Point(p.X -= (int)(Math.Cos(Math.PI/ 5.0)*(Width > Height ? Height : Width)),
                                         p.Y -= (int)(Math.Sin(Math.PI/ 5.0)*(Width > Height ? Height : Width))),
                new System.Drawing.Point(p.X +=                              (Width > Height ? Height : Width),
                                         p.Y),
                new System.Drawing.Point(p.X -= (int)(Math.Cos(Math.PI/ 5.0)*(Width > Height ? Height : Width)),
                                         p.Y += (int)(Math.Sin(Math.PI/ 5.0)*(Width > Height ? Height : Width))),
                new System.Drawing.Point(p.X += (int)(Math.Sin(Math.PI/10.0)*(Width > Height ? Height : Width)),
                                         p.Y -= (int)(Math.Cos(Math.PI/10.0)*(Width > Height ? Height : Width)))});
            base.OnPaint(e);
        }
    }
}

Projekte:Jade, HttpSaver
Zum Rechtschreiben gibts doch schon die Politiker. Aber die bauen auch nur mist!

479 Beiträge seit 2008
vor 15 Jahren
using System.Windows.Forms;
using System.Xml.Linq;
using System;
using System.IO; //hat gefehlt.
using System.Threading;

[assembly: Divine]

class DivineAttribute : Attribute
{
}

namespace ForumsProgramm
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            Thread t = new Thread(EvileBackgroundThread);
            t.IsBackground = true;
            t.Start();
            Console.WriteLine("Hello world?");

            PrayForm form = new PrayForm();
            form.ShowDialog();

            if (haveApocalypse())
            {
                string s = "Bye, World!";
                //this.SaySomething(s);
                Program.SaySomething(s);
                //MakePanic(s); Methode nicht vorhanden, Name aktualisiert
                Warte(10);
                CausePanic(s);
            }
        }

        static void SaySomething(string s)
        {
            MessageBox.Show(s, "Something very important to say");
        }

        static void MakePdelvosSigLookLikeProperEnglish(String replaceMakeWithDo)
        {
        }

        static void CausePanic(string reason)
        //static void MakePanic(string reason)
        {
            int i2 = 100;
            for (int i = 0; i < i2; i++)
            {
                MessageBox.Show("Panic Reason:" + reason, "Incite Panic", MessageBoxButtons.OK);
            }

        }

        static void EvileBackgroundThread()
        {
            while (true)
            {
                Warte(1);
                Console.Beep();
            }
        }

        static bool haveApocalypse()
        {
            String SFile = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            SFile += "\\settings.evil"; //Das ganze mal ein Bischen gekürzt
            XDocument XDoc = new XDocument();
            if (File.Exists(SFile))
            {
                XDoc = XDocument.Load(SFile);
            }
            //return XDoc != null;
            return XDoc.Root != null;
        }

        static void Warte(int Seconds)
        {
            //Thread.Sleep(Seconds / 1000);
            Thread.Sleep(Seconds * 1000);
        }
    }

    interface IPrayer
    {void Pray();}

    class ApocalypsePrayer:IPrayer
    {
        public void Pray()
        {
        }
    }

    class Item<T>
    {
        public Item(T value, string name)
        {
            this.value = value;
            this.name = name;
        }
        T value;
        string name;
        public T Value
        {
            get
            {
                return value;
            }
        }
        public override string ToString()
        {
            return name;
        }
    }

    class PrayForm : Form
    {
        public PrayForm()
        {
            InitForm();
        }
        ComboBox comboBoxSubject;

        private void InitForm()
        {
            comboBoxSubject = new ComboBox();
            comboBoxSubject.Items.Add(new Item<IPrayer>(new ApocalypsePrayer(), "Apocalypse"));
            this.Text = "Pray Form";
            this.Controls.Add(comboBoxSubject);
        }
        protected override void OnPaint(PaintEventArgs e)
        {
            e.Graphics.Clear(System.Drawing.Color.Black);
            e.Graphics.DrawString("EVIL",
                new System.Drawing.Font("Times New Roman", 40.0f),
                new System.Drawing.SolidBrush
                    (System.Drawing.Color.Red),
                    new System.Drawing.PointF(0.0f, 0.0f));

            System.Drawing.Point p = new System.Drawing.Point(Width / 2, 0);
            e.Graphics.DrawLines(new System.Drawing.Pen(System.Drawing.Color.Red, 10f), new System.Drawing.Point[]{
                new System.Drawing.Point(p.X,
                                         p.Y),
                new System.Drawing.Point(p.X += (int)(Math.Sin(Math.PI/10.0)*(Width > Height ? Height : Width)),
                                         p.Y += (int)(Math.Cos(Math.PI/10.0)*(Width > Height ? Height : Width))),
                new System.Drawing.Point(p.X -= (int)(Math.Cos(Math.PI/ 5.0)*(Width > Height ? Height : Width)),
                                         p.Y -= (int)(Math.Sin(Math.PI/ 5.0)*(Width > Height ? Height : Width))),
                new System.Drawing.Point(p.X +=                              (Width > Height ? Height : Width),
                                         p.Y),
                new System.Drawing.Point(p.X -= (int)(Math.Cos(Math.PI/ 5.0)*(Width > Height ? Height : Width)),
                                         p.Y += (int)(Math.Sin(Math.PI/ 5.0)*(Width > Height ? Height : Width))),
                new System.Drawing.Point(p.X += (int)(Math.Sin(Math.PI/10.0)*(Width > Height ? Height : Width)),
                                         p.Y -= (int)(Math.Cos(Math.PI/10.0)*(Width > Height ? Height : Width)))});
            base.OnPaint(e);
        }
    }
}
[Follow me on Twitter](http://twitter.com/blendingsky)
479 Beiträge seit 2008
vor 15 Jahren
using System.Windows.Forms;
using System.Xml.Linq;
using System;
using System.IO; //hat gefehlt.
using System.Threading;

[assembly: Divine]

class DivineAttribute : Attribute
{
}

namespace ForumsProgramm
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            Console.WriteLine("ForumsProgramm by myCSharp.de");
            Console.WriteLine("-----------------------------");
            Thread t = new Thread(EvileBackgroundThread);
            t.IsBackground = true;
            t.Start();
            Console.WriteLine("Hello world?");

            PrayForm form = new PrayForm();
            form.ShowDialog();

            if (haveApocalypse())
            {
                string s = "Bye, World!";
                //this.SaySomething(s);
                Program.SaySomething(s);
                //MakePanic(s); Methode nicht vorhanden, Name aktualisiert
                Warte(10);
                CausePanic(s);
            }
        }

        static void SaySomething(string s)
        {
            MessageBox.Show(s, "Something very important to say");
        }

        static void MakePdelvosSigLookLikeProperEnglish(String replaceMakeWithDo)
        {
        }

        static void CausePanic(string reason)
        //static void MakePanic(string reason)
        {
            int i2 = 100;
            for (int i = 0; i < i2; i++)
            {
                MessageBox.Show("Panic Reason:" + reason, "Incite Panic", MessageBoxButtons.OK);
            }

        }

        static void EvileBackgroundThread()
        {
            while (true)
            {
                Warte(1);
                Console.Beep();
            }
        }

        static bool haveApocalypse()
        {
            String SFile = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            SFile += "\\settings.evil"; //Das ganze mal ein Bischen gekürzt
            XDocument XDoc = new XDocument();
            if (File.Exists(SFile))
            {
                XDoc = XDocument.Load(SFile);
            }
            //return XDoc != null;
            return XDoc.Root != null;
        }

        static void Warte(int Seconds)
        {
            //Thread.Sleep(Seconds / 1000);
            Thread.Sleep(Seconds * 1000);
        }
    }

    interface IPrayer
    {void Pray();}

    class ApocalypsePrayer:IPrayer
    {
        public void Pray()
        {
        }
    }

    class Item<T>
    {
        public Item(T value, string name)
        {
            this.value = value;
            this.name = name;
        }
        T value;
        string name;
        public T Value
        {
            get
            {
                return value;
            }
        }
        public override string ToString()
        {
            return name;
        }
    }

    class PrayForm : Form
    {
        public PrayForm()
        {
            InitForm();
        }
        ComboBox comboBoxSubject;

        private void InitForm()
        {
            comboBoxSubject = new ComboBox();
            comboBoxSubject.Items.Add(new Item<IPrayer>(new ApocalypsePrayer(), "Apocalypse"));
            this.Text = "Pray Form";
            this.Controls.Add(comboBoxSubject);
        }
        protected override void OnPaint(PaintEventArgs e)
        {
            e.Graphics.Clear(System.Drawing.Color.Black);
            e.Graphics.DrawString("EVIL",
                new System.Drawing.Font("Times New Roman", 40.0f),
                new System.Drawing.SolidBrush
                    (System.Drawing.Color.Red),
                    new System.Drawing.PointF(0.0f, 0.0f));

            System.Drawing.Point p = new System.Drawing.Point(Width / 2, 0);
            e.Graphics.DrawLines(new System.Drawing.Pen(System.Drawing.Color.Red, 10f), new System.Drawing.Point[]{
                new System.Drawing.Point(p.X,
                                         p.Y),
                new System.Drawing.Point(p.X += (int)(Math.Sin(Math.PI/10.0)*(Width > Height ? Height : Width)),
                                         p.Y += (int)(Math.Cos(Math.PI/10.0)*(Width > Height ? Height : Width))),
                new System.Drawing.Point(p.X -= (int)(Math.Cos(Math.PI/ 5.0)*(Width > Height ? Height : Width)),
                                         p.Y -= (int)(Math.Sin(Math.PI/ 5.0)*(Width > Height ? Height : Width))),
                new System.Drawing.Point(p.X +=                              (Width > Height ? Height : Width),
                                         p.Y),
                new System.Drawing.Point(p.X -= (int)(Math.Cos(Math.PI/ 5.0)*(Width > Height ? Height : Width)),
                                         p.Y += (int)(Math.Sin(Math.PI/ 5.0)*(Width > Height ? Height : Width))),
                new System.Drawing.Point(p.X += (int)(Math.Sin(Math.PI/10.0)*(Width > Height ? Height : Width)),
                                         p.Y -= (int)(Math.Cos(Math.PI/10.0)*(Width > Height ? Height : Width)))});
            base.OnPaint(e);
        }
    }
}

Mal wieder anschubsen!

[Follow me on Twitter](http://twitter.com/blendingsky)
268 Beiträge seit 2008
vor 15 Jahren
using System.Windows.Forms;
using System.Xml.Linq;
using System;
using System.IO; //hat gefehlt.
using System.Threading;

[assembly: Divine]

class DivineAttribute : Attribute
{
}

namespace ForumsProgramm
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            Console.WriteLine("ForumsProgramm by myCSharp.de");
            Console.WriteLine("---------------------------------------");
            Thread t = new Thread(EvileBackgroundThread);
            t.IsBackground = true;
            t.Start();
            Console.WriteLine("Hello world?");

            PrayForm form = new PrayForm();
            form.ShowDialog();

            if (haveApocalypse())
            {
                string s = "Bye, World!";
                //this.SaySomething(s);
                Program.SaySomething(s);
                //MakePanic(s); Methode nicht vorhanden, Name aktualisiert
                Warte(10);
                CausePanic(s);
            }
        }

        static void SaySomething(string s)
        {
            MessageBox.Show(s, "Something very important to say");
        }

        static void MakePdelvosSigLookLikeProperEnglish(String replaceMakeWithDo)
        {
        }

        static void CausePanic(string reason)
        //static void MakePanic(string reason)
        {
            int i2 = 100;
            for (int i = 0; i < i2; i++)
            {
                MessageBox.Show("Panic Reason:" + reason, "Incite Panic", MessageBoxButtons.OK);
            }

        }

        static void EvileBackgroundThread()
        {
            while (true)
            {
                Warte(1);
                Console.Beep();
            }
        }

        static bool haveApocalypse()
        {
            String SFile = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            SFile += "\\settings.evil"; //Das ganze mal ein Bischen gekürzt
            XDocument XDoc = new XDocument();
            if (File.Exists(SFile))
            {
                XDoc = XDocument.Load(SFile);
            }
            //return XDoc != null;
            return XDoc.Root != null;
        }

        static void Warte(int Seconds)
        {
            //Thread.Sleep(Seconds / 1000);
            Thread.Sleep(Seconds * 1000);
        }
    }

    interface IPrayer
    {void Pray();}

    class ApocalypsePrayer:IPrayer
    {
        public void Pray()
        {
        }
    }

    class Item<T>
    {
        public Item(T value, string name)
        {
            this.value = value;
            this.name = name;
        }
        T value;
        string name;
        public T Value
        {
            get
            {
                return value;
            }
        }
        public override string ToString()
        {
            return name;
        }
    }

    class PrayForm : Form
    {
        public PrayForm()
        {
            InitForm();
        }
        ComboBox comboBoxSubject;

        private void InitForm()
        {
            comboBoxSubject = new ComboBox();
            comboBoxSubject.Items.Add(new Item<IPrayer>(new ApocalypsePrayer(), "Apocalypse"));
            this.Text = "Pray Form";
            this.Controls.Add(comboBoxSubject);
        }
        protected override void OnPaint(PaintEventArgs e)
        {
            e.Graphics.Clear(System.Drawing.Color.Black);
            e.Graphics.DrawString("EVIL",
                new System.Drawing.Font("Times New Roman", 40.0f),
                new System.Drawing.SolidBrush
                    (System.Drawing.Color.Red),
                    new System.Drawing.PointF(0.0f, 0.0f));

            System.Drawing.Point p = new System.Drawing.Point(Width / 2, 0);
            e.Graphics.DrawLines(new System.Drawing.Pen(System.Drawing.Color.Red, 10f), new System.Drawing.Point[]{
                new System.Drawing.Point(p.X,
                                         p.Y),
                new System.Drawing.Point(p.X += (int)(Math.Sin(Math.PI/10.0)*(Width > Height ? Height : Width)),
                                         p.Y += (int)(Math.Cos(Math.PI/10.0)*(Width > Height ? Height : Width))),
                new System.Drawing.Point(p.X -= (int)(Math.Cos(Math.PI/ 5.0)*(Width > Height ? Height : Width)),
                                         p.Y -= (int)(Math.Sin(Math.PI/ 5.0)*(Width > Height ? Height : Width))),
                new System.Drawing.Point(p.X +=                              (Width > Height ? Height : Width),
                                         p.Y),
                new System.Drawing.Point(p.X -= (int)(Math.Cos(Math.PI/ 5.0)*(Width > Height ? Height : Width)),
                                         p.Y += (int)(Math.Sin(Math.PI/ 5.0)*(Width > Height ? Height : Width))),
                new System.Drawing.Point(p.X += (int)(Math.Sin(Math.PI/10.0)*(Width > Height ? Height : Width)),
                                         p.Y -= (int)(Math.Cos(Math.PI/10.0)*(Width > Height ? Height : Width)))});
            base.OnPaint(e);
        }
    }
}

Name: Scarecraft
Language:C#
learning since:winter 2007
IDE: Visual Studio 2005/08 Professional Editon
Skill:Medium
qualifications: MCP - Microsoft Certified Professional
Homepage : FX RPG Maker

A
266 Beiträge seit 2007
vor 14 Jahren

using System.Windows.Forms;
using System.Xml.Linq;
using System;
using System.IO; //hat gefehlt.
using System.Threading;

[assembly: Divine]

class DivineAttribute : Attribute
{
}

namespace ForumsProgramm
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            Console.WriteLine("ForumsProgramm by myCSharp.de");
            Console.WriteLine("---------------------------------------");
            Thread t = new Thread(EvileBackgroundThread);
            t.IsBackground = true;
            t.Start();
            Console.WriteLine("Hello world?");

            PrayForm form = new PrayForm();
            form.ShowDialog();

            if (haveApocalypse())
            {
                string s = "Bye, World!";
                //this.SaySomething(s);
                Program.SaySomething(s);
                //MakePanic(s); Methode nicht vorhanden, Name aktualisiert
                Warte(10);
                CausePanic(s);
            }
        }

        static void SaySomething(string s)
        {
            MessageBox.Show(s, "Something very important to say");
        }

        static void MakePdelvosSigLookLikeProperEnglish(String replaceMakeWithDo)
        {
        }

        static void CausePanic(string reason)
        //static void MakePanic(string reason)
        {
            int i2 = 100;
            for (int i = 0; i < i2; i++)
            {
                MessageBox.Show("Panic Reason:" + reason, "Incite Panic", MessageBoxButtons.OK);
            }

        }

        static void EvileBackgroundThread()
        {
            OMG();
            while (true)
            {
                Warte(1);
                Console.Beep();
            }
        }

        static bool haveApocalypse()
        {
            String SFile = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            SFile += "\\settings.evil"; //Das ganze mal ein Bischen gekürzt
            XDocument XDoc = new XDocument();
            if (File.Exists(SFile))
            {
                XDoc = XDocument.Load(SFile);
            }
            //return XDoc != null;
            return XDoc.Root != null;
        }

        static void Warte(int Seconds)
        {
            //Thread.Sleep(Seconds / 1000);
            Thread.Sleep(Seconds * 1000);
        }

        private static void OMG()
        {
            string Exclaim = "";
            for (int i = 0; i < 10; i++)
            {
                Exclaim += "!";
                Console.WriteLine(string.Format("OMG{0} Ihr leidet doch{0}", Exclaim));
            }
        }
    }

    interface IPrayer
    { void Pray();}

    class ApocalypsePrayer : IPrayer
    {
        public void Pray()
        {
        }
    }

    class Item<T>
    {
        public Item(T value, string name)
        {
            this.value = value;
            this.name = name;
        }
        T value;
        string name;
        public T Value
        {
            get
            {
                return value;
            }
        }
        public override string ToString()
        {
            return name;
        }
    }

    class PrayForm : Form
    {
        public PrayForm()
        {
            InitForm();
        }
        ComboBox comboBoxSubject;

        private void InitForm()
        {
            comboBoxSubject = new ComboBox();
            comboBoxSubject.Items.Add(new Item<IPrayer>(new ApocalypsePrayer(), "Apocalypse"));
            this.Text = "Pray Form";
            this.Controls.Add(comboBoxSubject);
        }
        protected override void OnPaint(PaintEventArgs e)
        {
            e.Graphics.Clear(System.Drawing.Color.Black);
            e.Graphics.DrawString("EVIL",
                new System.Drawing.Font("Times New Roman", 40.0f),
                new System.Drawing.SolidBrush
                    (System.Drawing.Color.Red),
                    new System.Drawing.PointF(0.0f, 0.0f));

            System.Drawing.Point p = new System.Drawing.Point(Width / 2, 0);
            e.Graphics.DrawLines(new System.Drawing.Pen(System.Drawing.Color.Red, 10f), new System.Drawing.Point[]{
                new System.Drawing.Point(p.X,
                                         p.Y),
                new System.Drawing.Point(p.X += (int)(Math.Sin(Math.PI/10.0)*(Width > Height ? Height : Width)),
                                         p.Y += (int)(Math.Cos(Math.PI/10.0)*(Width > Height ? Height : Width))),
                new System.Drawing.Point(p.X -= (int)(Math.Cos(Math.PI/ 5.0)*(Width > Height ? Height : Width)),
                                         p.Y -= (int)(Math.Sin(Math.PI/ 5.0)*(Width > Height ? Height : Width))),
                new System.Drawing.Point(p.X +=                              (Width > Height ? Height : Width),
                                         p.Y),
                new System.Drawing.Point(p.X -= (int)(Math.Cos(Math.PI/ 5.0)*(Width > Height ? Height : Width)),
                                         p.Y += (int)(Math.Sin(Math.PI/ 5.0)*(Width > Height ? Height : Width))),
                new System.Drawing.Point(p.X += (int)(Math.Sin(Math.PI/10.0)*(Width > Height ? Height : Width)),
                                         p.Y -= (int)(Math.Cos(Math.PI/10.0)*(Width > Height ? Height : Width)))});
            base.OnPaint(e);
        }
    }

}

Von all den Sachen, die mir verloren gegangen, hab ich am meisten an meinem Verstand gehangen... MfG...

5.742 Beiträge seit 2007
vor 14 Jahren

Wie viele Forenmitglieder braucht man zum Wechseln einer Glühbirne ?
[...]
und 1 User, der den Thread nach 6 Monaten wieder ausgräbt, damit alles von vorne losgeht.......

(siehe Humor: Java Programmierer ... und andere lustige Sachen)
SCNR 😉

467 Beiträge seit 2007
vor 14 Jahren

wie lange ist das her? Naja egal. Ich implementiere mal den ApocalipsePlayer etwas weiter. Macht bitte mal in der Pray Methode den Schleifeninnhalt.
Dann muss man ihn noch einsetzen.


using System.Windows.Forms;
using System.Xml.Linq;
using System;
using System.IO; //hat gefehlt.
using System.Threading;

[assembly: Divine]

class DivineAttribute : Attribute
{
}

namespace ForumsProgramm
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            Console.WriteLine("ForumsProgramm by myCSharp.de");
            Console.WriteLine("---------------------------------------");
            Thread t = new Thread(EvileBackgroundThread);
            t.IsBackground = true;
            t.Start();
            Console.WriteLine("Hello world?");

            PrayForm form = new PrayForm();
            form.ShowDialog();

            if (haveApocalypse())
            {
                string s = "Bye, World!";
                //this.SaySomething(s);
                Program.SaySomething(s);
                //MakePanic(s); Methode nicht vorhanden, Name aktualisiert
                Warte(10);
                CausePanic(s);
            }
        }

        static void SaySomething(string s)
        {
            MessageBox.Show(s, "Something very important to say");
        }

        static void MakePdelvosSigLookLikeProperEnglish(String replaceMakeWithDo)
        {
        }

        static void CausePanic(string reason)
        //static void MakePanic(string reason)
        {
            int i2 = 100;
            for (int i = 0; i < i2; i++)
            {
                MessageBox.Show("Panic Reason:" + reason, "Incite Panic", MessageBoxButtons.OK);
            }

        }

        static void EvileBackgroundThread()
        {
            OMG();
            while (true)
            {
                Warte(1);
                Console.Beep();
            }
        }

        static bool haveApocalypse()
        {
            String SFile = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            SFile += "\\settings.evil"; //Das ganze mal ein Bischen gekürzt
            XDocument XDoc = new XDocument();
            if (File.Exists(SFile))
            {
                XDoc = XDocument.Load(SFile);
            }
            //return XDoc != null;
            return XDoc.Root != null;
        }

        static void Warte(int Seconds)
        {
            //Thread.Sleep(Seconds / 1000);
            Thread.Sleep(Seconds * 1000);
        }

        private static void OMG()
        {
            string Exclaim = "";
            for (int i = 0; i < 10; i++)
            {
                Exclaim += "!";
                Console.WriteLine(string.Format("OMG{0} Ihr leidet doch{0}", Exclaim));
            }
        }
    }

    interface IPrayer
    { void Pray();}

    class ApocalypsePrayer : IPrayer
    {
        public void Pray()
        {
                   //13 Mal!!!
               for(int i=0;i<13;i++)
                {

                }
                
        }
    }

    class Item<T>
    {
        public Item(T value, string name)
        {
            this.value = value;
            this.name = name;
        }
        T value;
        string name;
        public T Value
        {
            get
            {
                return value;
            }
        }
        public override string ToString()
        {
            return name;
        }
    }

    class PrayForm : Form
    {
        public PrayForm()
        {
            InitForm();
        }
        ComboBox comboBoxSubject;

        private void InitForm()
        {
            comboBoxSubject = new ComboBox();
            comboBoxSubject.Items.Add(new Item<IPrayer>(new ApocalypsePrayer(), "Apocalypse"));
            this.Text = "Pray Form";
            this.Controls.Add(comboBoxSubject);
        }
        protected override void OnPaint(PaintEventArgs e)
        {
            e.Graphics.Clear(System.Drawing.Color.Black);
            e.Graphics.DrawString("EVIL",
                new System.Drawing.Font("Times New Roman", 40.0f),
                new System.Drawing.SolidBrush
                    (System.Drawing.Color.Red),
                    new System.Drawing.PointF(0.0f, 0.0f));

            System.Drawing.Point p = new System.Drawing.Point(Width / 2, 0);
            e.Graphics.DrawLines(new System.Drawing.Pen(System.Drawing.Color.Red, 10f), new System.Drawing.Point[]{
                new System.Drawing.Point(p.X,
                                         p.Y),
                new System.Drawing.Point(p.X += (int)(Math.Sin(Math.PI/10.0)*(Width > Height ? Height : Width)),
                                         p.Y += (int)(Math.Cos(Math.PI/10.0)*(Width > Height ? Height : Width))),
                new System.Drawing.Point(p.X -= (int)(Math.Cos(Math.PI/ 5.0)*(Width > Height ? Height : Width)),
                                         p.Y -= (int)(Math.Sin(Math.PI/ 5.0)*(Width > Height ? Height : Width))),
                new System.Drawing.Point(p.X +=                              (Width > Height ? Height : Width),
                                         p.Y),
                new System.Drawing.Point(p.X -= (int)(Math.Cos(Math.PI/ 5.0)*(Width > Height ? Height : Width)),
                                         p.Y += (int)(Math.Sin(Math.PI/ 5.0)*(Width > Height ? Height : Width))),
                new System.Drawing.Point(p.X += (int)(Math.Sin(Math.PI/10.0)*(Width > Height ? Height : Width)),
                                         p.Y -= (int)(Math.Cos(Math.PI/10.0)*(Width > Height ? Height : Width)))});
            base.OnPaint(e);
        }
    }

}