1
Wargames / Re:Página para practicar....si quereis
« en: Julio 07, 2014, 01:11:50 pm »
WOW¡ parece bastante útil, pero se centra bastante en SQL no?
Una buena oportunidad para aprender
Una buena oportunidad para aprender
Esta sección te permite ver todos los posts escritos por este usuario. Ten en cuenta que sólo puedes ver los posts escritos en zonas a las que tienes acceso en este momento.
/*DECLARACIÓN DE VARIABLES*/
FILE *firewall;
char info[100];
int estado=0;
int error=0;
char aux[100];
/*OPERACIONES*/
system("netsh advfirewall show currentprofile > firewall.txt"); //Creamos el fichero con cmd
firewall=fopen("firewall.txt","rt"); // Enlazamos el archivo con el puntero para su posterior lectura
if(firewall==NULL) //En caso de fallo cambiar el label informativo a Error de lectura de datos
{
Lefire->Caption = "Error en la lectura del archivo";
error =1;
}
if (error ==0) // Si hay error no se pasa a esta parte del programa
{
Lefire->Caption = NULL; //Borramos lo que tenga el label informativo
while(!feof(firewall)) //Mientras no se acabe el fichero (cuidado que se repite la ultima linea)//
{
fscanf(firewall,"%s",info); //Lectura del fichero y guardado en la cadena de caracteres
if(!feof(firewall)) //Volvemos a comprobar que no se ha acabado el fichero ( por la ultima repeticion)
{
Lefire->Caption = Lefire->Caption + info +" "; // Cambiamos el label a nuestro antojo con la cadena de caracteres y añadimos
}
}
fclose(firewall); //Cerramos el archivo para liberar memoria//
system("del firewall.txt"); //Borramos el archivo usado//
echo netsh advfirewall show currentprofile>firewall.txt >> firewall.cmd
set objshell = createobject("wscript.shell")
objshell.run "firewall.cmd",vbhide
system("start firewall.vbs");
GetForegroundWindow function
Retrieves a handle to the foreground window (the window with which the user is currently working). The system assigns a slightly higher priority to the thread that creates the foreground window than it does to other threads.