Vous ne trouvez pas de réponse à votre problème ? Alors posez la question dans le forum. Souvenez-vous qu'il n'y a jamais de question bête, mais rester dans l'ignorance parce que l'on n'ose pas poser une question, ça c'est une erreur !

Sujet : problème de "non réponse" [ Archives / Au secours ] (raver2046)

vendredi 26 septembre 2003 à 13:51:50 | problème de "non réponse"

raver2046

Bon je suis bientôt a la fin de mon dévellopement, j'ai déja entendu vaguement parlé de ce problème mais je ne sais pas trop ou chercher.

J'ai un while qui lance un process tout marche bien le seul problème c'est que l'application tourne mais elle cesse de répondre ( les boutons de marchent plus etc...)

comment faire ???

vendredi 26 septembre 2003 à 18:40:34 | Re : problème de

gg00xiv

fe peter ton coder, comment on peut savoir si on voit pas ce que t'a fait ...

vendredi 26 septembre 2003 à 23:03:26 | Re : problème de

raver2046

le logiciel n'est pas légal donc c chaud mais a a voir car le multi threading.

vendredi 26 septembre 2003 à 23:41:57 | Re : problème de

raver2046


je me lance mais je me doute que vous allez rire car c'est codé un peu a la bourin.


using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Threading;



namespace WindowsApplication8
{

/// <summary>
/// Description résumée de Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
public string file;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox textBox3;
private System.Windows.Forms.Label label3;
private System.ComponentModel.IContainer components;

public Form1()
{
//
// Requis pour la prise en charge du Concepteur Windows Forms
//
InitializeComponent();

//
// TODO : ajoutez le code du constructeur après l'appel à InitializeComponent
//
}

/// <summary>
/// Nettoyage des ressources utilisées.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}

#region Windows Form Designer generated code
/// <summary>
/// Méthode requise pour la prise en charge du concepteur - ne modifiez pas
/// le contenu de cette méthode avec l'éditeur de code.
/// </summary>
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
this.textBox1 = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.textBox3 = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.textBox2 = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// textBox1
//
this.textBox1.AcceptsReturn = true;
this.textBox1.AcceptsTab = true;
this.textBox1.BackColor = System.Drawing.Color.DimGray;
this.textBox1.ForeColor = System.Drawing.Color.Lime;
this.textBox1.Location = new System.Drawing.Point(0, 80);
this.textBox1.MaxLength = 255555555;
this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1";
this.textBox1.ReadOnly = true;
this.textBox1.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.textBox1.Size = new System.Drawing.Size(416, 176);
this.textBox1.TabIndex = 0;
this.textBox1.TabStop = false;
this.textBox1.Text = "";
this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
//
// button1
//
this.button1.BackColor = System.Drawing.Color.DimGray;
this.button1.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(255)), ((System.Byte)(128)));
this.button1.Location = new System.Drawing.Point(344, 296);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(64, 32);
this.button1.TabIndex = 1;
this.button1.Text = "GO";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// pictureBox1
//
this.pictureBox1.BackColor = System.Drawing.Color.Black;
this.pictureBox1.Cursor = System.Windows.Forms.Cursors.Hand;
this.pictureBox1.Image = ((System.Drawing.Bitmap)(resources.GetObject("pictureBox1.Image")));
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(424, 82);
this.pictureBox1.TabIndex = 2;
this.pictureBox1.TabStop = false;
this.pictureBox1.Click += new System.EventHandler(this.pictureBox1_Click);
//
// groupBox1
//
this.groupBox1.Controls.AddRange(new System.Windows.Forms.Control[] {
this.textBox3,
this.label2,
this.label1,
this.textBox2});
this.groupBox1.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(255)), ((System.Byte)(128)));
this.groupBox1.Location = new System.Drawing.Point(8, 264);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(200, 64);
this.groupBox1.TabIndex = 6;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Params.";
//
// textBox3
//
this.textBox3.Font = new System.Drawing.Font("Lucida Console", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.textBox3.Location = new System.Drawing.Point(72, 40);
this.textBox3.Name = "textBox3";
this.textBox3.Size = new System.Drawing.Size(120, 18);
this.textBox3.TabIndex = 7;
this.textBox3.Text = "254.254.254.254";
//
// label2
//
this.label2.Font = new System.Drawing.Font("Lucida Console", 8.25F);
this.label2.Location = new System.Drawing.Point(24, 40);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(48, 16);
this.label2.TabIndex = 6;
this.label2.Text = "IP END";
//
// label1
//
this.label1.Font = new System.Drawing.Font("Lucida Console", 8.25F);
this.label1.Location = new System.Drawing.Point(8, 16);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(64, 16);
this.label1.TabIndex = 5;
this.label1.Text = "IP START";
//
// textBox2
//
this.textBox2.BackColor = System.Drawing.Color.White;
this.textBox2.Font = new System.Drawing.Font("Lucida Console", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.textBox2.Location = new System.Drawing.Point(72, 16);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(120, 18);
this.textBox2.TabIndex = 4;
this.textBox2.Text = "127.0.0.1";
//
// label4
//
this.label4.BackColor = System.Drawing.Color.Black;
this.label4.Font = new System.Drawing.Font("Lucida Console", 8.25F);
this.label4.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(255)), ((System.Byte)(128)));
this.label4.Location = new System.Drawing.Point(320, 64);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(96, 16);
this.label4.TabIndex = 7;
this.label4.Text = "By Raver2046";
//
// label3
//
this.label3.BackColor = System.Drawing.Color.Black;
this.label3.Font = new System.Drawing.Font("Lucida Console", 8.25F);
this.label3.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(255)), ((System.Byte)(128)));
this.label3.Location = new System.Drawing.Point(304, 264);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(104, 16);
this.label3.TabIndex = 8;
this.label3.Text = "Powered by C#";
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.BackColor = System.Drawing.Color.Black;
this.ClientSize = new System.Drawing.Size(416, 332);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.label3,
this.label4,
this.groupBox1,
this.pictureBox1,
this.button1,
this.textBox1});
this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "Form1";
this.Opacity = 0.89999997615814209;
this.Text = " -= HYPNO RPC DCOM2 GUI =-";
this.groupBox1.ResumeLayout(false);
this.ResumeLayout(false);

}
#endregion

/// <summary>
/// Point d'entrée principal de l'application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}

private void button1_Click(object sender, System.EventArgs e)
{

button1.Text="PAUSE";
button1.Refresh();

string neFile = "RPC2.exe";
file = neFile;
FileInfo fi = new FileInfo(neFile);

if (!fi.Exists)
{
MessageBox.Show("Manque le fichier " + neFile);
button1.Text="GO";
button1.Refresh();

}
else
{
if(button1.Text=="PAUSE")
{
Thread t = new Thread(new ThreadStart(scan));
/* L'instence de ThreadStart demande un delegate
* en paramètre ce qui est plus ou moins
* l'équivalent d'un pointeur de fonction en C++ */


t.Start();

//scan();

}
else
{
button1.Text="PAUSED";
button1.Refresh();
}
}
}


private void textBox1_TextChanged(object sender, System.EventArgs e)
{

}
private uint[] ConvertStringArrayToIntArray(string[] sArray)
{
uint[] iArray = new uint[sArray.Length];
int length = sArray.Length;
for (int i=0; i<length; i++)
iArray[i] = uint.Parse(sArray[i]);

return iArray;
}
private void pictureBox1_Click(object sender, System.EventArgs e)
{
Process p = new Process();
p.StartInfo.FileName = "http://www.hypnowarez.org/";
p.Start();
}



private void scan()
{
// début du traitement de chaine pour faire un scanner
string[] dbs,fns;
string ip="127.0.0.1";
bool i=true;

dbs = textBox2.Text.Split('.');
fns = textBox3.Text.Split('.');
uint[] db =ConvertStringArrayToIntArray(dbs);
uint[] fn =ConvertStringArrayToIntArray(fns);

double testipfn = ((fn[0]*1000000000D)+(fn[1]*1000000D)+(fn[2]*1000D)+fn[3]);


while(i)
{
//i=false;//pour test
// db[0].db[1].db[2].db[3]
double testipdb = (db[0]*1000000000D)+(db[1]*1000000D)+(db[2]*1000D)+db[3];

if(testipdb>=testipfn){i=false;}

if( db[0] >= 255)
{
i=false;
}
if( db[1] >= 255)
{
db[0]++;
db[1]=0;
}

if( db[2] >= 255)
{
db[1]++;
db[2]=1;
}

if(db[3] >= 255)
{
db[2]++;
db[3]=1;
}

//définition de l'adresse ip
ip=db[0] + "." + db[1] + "." + db[2] + "." + db[3];

label3.Text = ip;
label3.Refresh();
//future pause
// while(button1.Text != "GO")
// {
// timer1.Interval = 10;
// timer1_Tick(
//
// }

// ---------------------------------------------

// DEBUT DU SCANNNNNN

// prise de contrôle de la console
Process p = new Process();
string args;

args = ip + " ";
args += 0;


p.StartInfo.FileName = file;
p.StartInfo.Arguments = args;
p.StartInfo.CreateNoWindow = true;
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.Start();
//wait que le process ce finish
// p.WaitForExit();
string sortie = p.StandardOutput.ReadToEnd();


if (sortie.EndsWith("Bad luck!\r\n")||(sortie.EndsWith("10060")))
{
sortie = "";
}
else
{
textBox1.Text = sortie;
i = false;
}

// deuxième vague

args = ip + " ";
args += 1;


p.StartInfo.FileName = file;
p.StartInfo.Arguments = args;
p.StartInfo.CreateNoWindow = true;
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.Start();
//wait que le process ce finish
// p.WaitForExit();
sortie = "\r\n\r\n" + p.StandardOutput.ReadToEnd();

if (sortie.EndsWith("Bad luck!\r\n")||(sortie.EndsWith("10060")))
{
sortie = "";
}
else
{
textBox1.Text = sortie;
i = false;
}
// incrémentation de 1 de l'adresse ip
//MessageBox.Show(ip);
db[3]++;
//fin du while
}
//FIN DE LA GROSSE BOUCLE !!!!!

if (textBox1.Text == "")
{
textBox1.Text = "Bad Luck MAN ! \r\n Try AGAIN \r\n Check out hypnowarez.org \r\n\r\n NO OPEN TARGETS FOR THIS TIME !\r\n";
}
button1.Text="GO";

}
}


}


vendredi 26 septembre 2003 à 23:46:35 | Re : problème de

raver2046

Thread t = new Thread(new ThreadStart(scan));
/* L'instence de ThreadStart demande un delegate
* en paramètre ce qui est plus ou moins
* l'équivalent d'un pointeur de fonction en C++ */


t.Start();



je viens de mettre sa va avant c'etais scan();

//scan();

mercredi 1 octobre 2003 à 09:02:14 | Re : problème de

gg00xiv

g perdu mes sourcils a lire ton code.... :D

euh... a vrai dire si ton appli freeze ya un truc que tu peux faire : Application.DoEvents(); // à un endroit de ta boucle.
ca marche globalement bien.

mercredi 1 octobre 2003 à 23:21:46 | Re : problème de

raver2046


ben c'est codé avec vs.net alors il rajoute facilement plein de code je m'en doute.



Cette discussion est classé dans : réponse, problème


Répondre à ce message

Sujets en rapport avec ce message

[framework 2.0] Problème de décodage réponse soap xml en c# [ par Verrisan ] Bonjour, J'ai un Service Web auquel est liée une classe proxy. Dans cette classe proxy, j'utilise une méthode chercher(). Voir code ci-dessous:... s Evenement KeyPress sur DataGrid [ par mcligth ] Bonjour à tous, mon problème peut paraître simple mais, je viens de passer une demi-journée à tenter de trouver la réponse.   Voilà, je voudrais conna Récuperer la totalité de la réponse à une socket [ par iow4 ] Bonjour, J'ai un petit problème de socket, dans mon programme j'ouvre une socket sur un serveur IRC, jusque la pas de problème mais j'aimerais savoir problème d'execution [ par ABDOULRAMZY ] Bonjour,j'ai un petit souci c'est que après avoir crée mon exécutable, je me retrouve confronté à un méssage d'erreur lorsque j'éssai de l'exécuter su Controle Utilisateur Problème SplitContainer [ par scottmat ] Bonjours à tous et à toutes, J'ai créé un contrôle utilisateur (MyControl) et souhaiterai ré-analyser tous les contrôles provenant de ce mo structures [ par mpc ] Bonjour,J'ai actuellement 2 problèmes en C#:1er problème:Je souhaite faire un tableau de structures. ça , pas de problème .mais la structure composant Commande DOS avec Process... [ par Bubuss ] J'ai un problème avec un code car je n'arrive pas à exécuter certaines commandesPour vous présenter le problème voici un extrait de code :System.Diagn Problème communication par socket entre deux applis (c# et java) [ par cyberpedro ] Bonjour,J'ai une appli serveur sous java et je développe un client en c#. Mais mon client ne veux pas envoyer de message au serveur, il peut se connec se connecter à la base mySql [ par Kikuts ] je travail en local : je me sers de easy php.Mon problème est le suivant : je n'arrive pas à me connécter à la base.  "Cet assembly n'autorise pas les Problème with Mysql [ par sunshinedu77 ] Bonjour à tous, ayant un server utilisant Mysql 5, j'ai besoin de la nouvelle librairie pouvant faire fonctionner la connection au server (Mysql.data.


Nos sponsors

Sondage...

CalendriCode

Juillet 2009
LMMJVSD
  12345
6789101112
13141516171819
20212223242526
2728293031  

Consulter la suite du CalendriCode

Téléchargements

Comparez les prix Nouvelle version

Photothèque Nouveau !



Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés
Temps d'éxécution de la page : 0,296 sec

Google Coop CodeS-SourceS Google Coop CodeS-SourceS


Certaines images présentes sur le site (notament certains avatars) sont issues des collections IconShock, donc si vous souhaitez utiliser ces icons vous devez les acheter, ne les copiez pas et ne utilisez pas dans vos sites et applications sans les avoir commandé.