Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Noticias
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #13  
Antiguo 31-07-2014
Avatar de nlsgarcia
[nlsgarcia] nlsgarcia is offline
Miembro Premium
 
Registrado: feb 2007
Ubicación: Caracas, Venezuela
Posts: 2.206
Poder: 21
nlsgarcia Tiene un aura espectacularnlsgarcia Tiene un aura espectacular
Club Delphi,

Cita:
Empezado por neftali2
...Testeando, testeando...


Código:
  using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Net;
  using System.IO;
  using System.Net.NetworkInformation;
    
  namespace TestClubDelphi
  {
      class Program
      {
          static bool CodeHtml(string Url)
          {
              HttpWebRequest Request = (HttpWebRequest)WebRequest.Create(Url);
              Request.Method = "GET";
              WebResponse reply = Request.GetResponse();
              
              string html;
    
              try
              {
                  using (StreamReader sr = new StreamReader(reply.GetResponseStream(), Encoding.UTF8))
                  {
                      html = sr.ReadToEnd();
                      using (StreamWriter sw = File.CreateText(@"C:\ClubDelphi.html"))
                      {
                          sw.WriteLine(html);
                      }
                  }
                  return true;
              }
              catch(Exception e)
              {
                  Console.WriteLine(e.Message);
                  return false;
              }
              finally
              {
                  reply.Close();
              }
          }
      
          static void Main(string[] args)
          {
              IPHostEntry address = Dns.GetHostEntry("www.clubdelphi.com");
              Ping Pings = new Ping();
              int timeout = 10000;
    
              if (Pings.Send(address.AddressList[0], timeout).Status == IPStatus.Success)
              {
                  if (CodeHtml("http://www.clubdelphi.com"))
                  {
                      Console.WriteLine("Club Delphi esta Online");
                  }
                  else
                  {
                      Console.WriteLine("Llamar a Casimiro :)");
                  }
              }
              else
              {
                  Console.WriteLine("Llamar a Casimiro :)");
              }
                          
              Console.ReadKey();
          }
      }
  }
Todo Ok

Nelson.
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Evento al entrar al Form lunygar Varios 5 11-01-2008 17:54:28
cuando llamo ejecutar un hilo dentro del proceso del hilo no lo hace robertosc Varios 1 14-08-2007 22:11:09
No me deja entrar xp a pc con win98 se ! Arturo Windows 0 15-05-2006 22:46:43
No me deja entrar al Interbase nuri Firebird e Interbase 2 14-07-2005 12:58:02
Cómo entrar a la disco roman Humor 24 31-05-2004 19:34:56


La franja horaria es GMT +2. Ahora son las 23:46:52.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi