Menú

Mostrar Mensajes

Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.

Mostrar Mensajes Menú

Mensajes - ABDERRAMAH

#811
Si sólo es un simple listín telefónico sería desaprobechar recursos una db, ¿no?
#812
Esto lo cito de http://www.elguille.info/colabora/NET2005/svalsse_leyendo_y_escribiendo_archivos.htm :

Citar
Leyendo desde un archivo usando BufferedStream

using System;
using System.Text;
using System.IO;

static void Main(string[] args)
{
    string path = "c:\\sample\\sample.xml";
    Stream instream = File.OpenRead(path);

    // crear buffer para abrir stream
    BufferedStream bufin = new BufferedStream(instream);
    byte[] bytes = new byte[128];

    // leer los primeros 128 bytes del archivo
    bufin.Read(bytes, 0, 128);
    Console.WriteLine("Allocated bytes: "+Encoding.ASCII.GetString(bytes));
}

Leyendo desde un archivo de texto

using System;
using System.IO;

static void Main(string[] args)
{
    string fileName = "temp.txt";
    FileStream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read);
    StreamReader reader = new StreamReader(stream);

    while (reader.Peek() > -1) Console.WriteLine(reader.ReadLine());
    reader.Close();
}

Escribiendo en un archive de texto

using System;
using System.IO;

static void Main(string[] args)
{
    string fileName = "temp.txt";
    FileStream stream = new FileStream(fileName, FileMode.OpenOrCreate, FileAccess.Write);
    StreamWriter writer = new StreamWriter(stream);

    writer.WriteLine("Esta es la primera línea del archivo.");
    writer.Close();
}

Creando un archivo y escribiendo en este

Este ejemplo usa el método CreateText() el cual crea un Nuevo archive y retorna un objeto StreamWriter que escribe a un archivo usando formato UTF-8.

using System;
using System.IO;

static void Main(string[] args)
{
    string fileName = "temp.txt";
    StreamWriter writer = File.CreateText(fileName);

    writer.WriteLine("Este es mi Nuevo archivo creado.");
    writer.Close();
}

Insertando texto en un archivo

using System;
using System.IO;

static void Main(string[] args)
{
    try
    {
        string fileName = "temp.txt";
        // esto inserta texto en un archivo existente, si el archivo no existe lo crea
        StreamWriter writer = File.AppendText(fileName);
        writer.WriteLine("Este es el texto adicionado.");
        writer.Close();
    }
    catch
    {
        Console.WriteLine("Error");
    }
}
#813
Foro Libre / Re: Feliz año nuevo 2010
31 Diciembre 2009, 16:37 PM

Dim año as long
Dim uva as fruit
  año=long(año+1)
  uva=1
    do while uva <=12
       system.eatonefruit(uva)
       uva=fruit(uva+1)
    loop
#814
en el source pone esto después del script para poner el punto:


<tr>
    <td width="100" valign="top"><b>Dirección IP</b></td>
    <td>: 25819.E5687.W2798.5TH67.00021</td>
   </tr>

 
   <tr>
    <td width="100" valign="top"><b>Pais</b></td>
    <td>: Tierra de Lockyer</td>
   </tr>
 
   <tr>
    <td width="100" valign="top"><b>Código de área</b></td>
    <td>: Z8801</td>

   </tr>
 
   <tr>
    <td width="100" valign="top"><b>Región</b></td>
    <td>: Los valles rojos</td>
   </tr>
 
   <tr>
    <td width="100" valign="top"><b>Ciudad</b></td>

    <td>: Valle Huaerte</td>
   </tr>
 
   <tr>
    <td width="100" valign="top"><b>Código ZIP</b></td>
    <td>: 10-087998571</td>
   </tr>



Misterio resuelto  ;)

Jeje, más curiosidades, introduces esto: 25819.E5687.W2798.5TH67.00021 y te dice esto:

Dirección IP     : 217.125.24.22
Pais    : Spain
Código de área    : 56
Región    : Catalonia
Ciudad    : Rubí
Reverse DNS    : 22.Red-217-125-24.staticIP.rima-tde.net
Direcciones IP a las que resuelve el Host    : 217.125.24.22

Provad tambien estos:
0.0.0.0
255.255.255.255
#815
¿eso es la luna o la tierra? ¿acaso los extraterrestres entran a elhacker.net desde la ip 25819.E5687.W2798.5TH67.00021? y otra cosa, esta dirección no es ipv6... será ip v8??   :o
#816
Mi favorito es...

Nuestro amigo el guardiacivil...





No, en serio, creo que randomize ha sido de los que más me ha ayudado, hay mas, pero no recuerdo el nombre.
#817
Foro Libre / Re: Edad Promedio de Usuarios del Foro.
10 Diciembre 2009, 07:15 AM
jeje, a ver quien se atreve a hacerlo en assembler  ;-)
#818
Foro Libre / Re: Edad Promedio de Usuarios del Foro.
10 Diciembre 2009, 05:44 AM
Cita de: d4n0n3 en  6 Diciembre 2009, 18:24 PM
Código (cpp) [Seleccionar]
# include <iostream>

using namespace std;

int main()
{
int edad=0;                  
cout << "MI NACIMIENTO Y..."<<endl;

for (edad=0;edad<21;edad++)
 {
 cout <<"CUMPLEANOS"<<endl;      
 }
cout <<"Hasta ahora que tengooo: " << edad << endl;
cout << "jejejeje os a gustado ehh"<<endl;
system("pause");  
}


Código (vb) [Seleccionar]


Function getedad()
Dim edad as int
Dim tmp as int
Dim startyear as long
   edad=0
   startyear=1984
   tmp=cint(2009-startyear)
   
do while edad<=tmp
   edad=cint(edad+1)
   startyear=startyear+1
   Console.writeline("Felicidades es el año "&cstr(startyear)& " y cumples "&cstr(edad))
loop

  Console.writeline("mi edad actual es de "&cstr(edad)&" años")
  getedad=cint(edad)
  exit function
end function


a mi se me da mejor el visualbasic xDDDDD