Foros del Web » Programando para Internet » ASPX (.net) »

De PHP a ASP.NET VB

Estas en el tema de De PHP a ASP.NET VB en el foro de ASPX (.net) en Foros del Web. Buenas buenas foros del web, se que hay muchas personas aquí que pueden ayudarme. No tengo idea de como pasar este PHP a ASP.NET VB, ...
  #1 (permalink)  
Antiguo 03/08/2010, 10:13
 
Fecha de Ingreso: agosto-2010
Mensajes: 1
Antigüedad: 13 años, 9 meses
Puntos: 0
De PHP a ASP.NET VB

Buenas buenas foros del web, se que hay muchas personas aquí que pueden ayudarme. No tengo idea de como pasar este PHP a ASP.NET VB, quiero pasarlo, ¿Me pueden ayudar?

<?php


header("Cache-Control: no-cache, must-revalidate");
header('Content-Type: text/html; charset=UTF-8');

// Mime Creation
$mime_boundary="==Multipart_Boundary_x".md5(mt_ran d())."x";

// ================================================== ================================================== ============================
// Open the upload files to be ready for the attachment
// ================================================== ================================================== ============================
$tmp_name = $_FILES['Filedata']['tmp_name'];
$type = $_FILES['Filedata']['type'];
$name = $_FILES['Filedata']['name'];
$size = $_FILES['Filedata']['size'];

// if the upload succeeded, the file will exist
if (file_exists($tmp_name)){

// check to make sure that it is an uploaded file and not a system file
if(is_uploaded_file($tmp_name))
{

// open the file for a binary read
$file = fopen($tmp_name,'rb');

// read the file content into a variable
$data = fread($file,filesize($tmp_name));

// close the file
fclose($file);

// now we encode it and split it into acceptable length lines
$data = chunk_split(base64_encode($data));
}
}

// ================================================== ================================================== ============================
// now we'll build the message headers
// ================================================== ================================================== ============================
$remitente = "[email protected]";
$headers = "From:".$remitente."\r\n" . "MIME-Version: 1.0\r\n" . "Content-Type: multipart/mixed;\r\n" . " boundary=\"{$mime_boundary}\"";

// ================================================== ================================================== ============================
// Message to send
// ================================================== ================================================== ============================
$subject = "Asunto del mensaje";
$message.= "INFORMACION:\n";
$message.= "\Mensaje de parte de : ".$_REQUEST[nombre]."\n";

$message = "This is a multi-part message in MIME format.\n\n" . "--{$mime_boundary}\n" . "Content-Type: text/plain; charset=\"utf-8\"\n" . "Content-Transfer-Encoding: 7bit\n\n" . $message . "\n\n";

$message .= "--{$mime_boundary}\n" .
"Content-Type: {$type};\n" .
" name=\"{$name}\"\n" .
"Content-Transfer-Encoding: base64\n\n" .
$data . "\n\n" .
"--{$mime_boundary}--\n";

// ================================================== ================================================== ============================
// Send Email
// ================================================== ================================================== ============================
// NOTE: in a real scenario you shouldn't send back the email to the sender,
// but you should set the customer email (i.e. [email protected] instead $_REQUEST[mail_txt])

if (@mail($_REQUEST[destinatario], $subject, ($message), $headers)){
// Return 1 if everything is ok and mail is sent
echo "1";
}
else {
// Return 0 if there are problems while sending mail
echo "0";
}


?>
  #2 (permalink)  
Antiguo 03/08/2010, 11:10
Avatar de jaullo  
Fecha de Ingreso: abril-2009
Mensajes: 994
Antigüedad: 15 años
Puntos: 30
Respuesta: De PHP a ASP.NET VB

Cual es la idea de este codigo, un file upload?
__________________
http://geekswithblogs.net/jaullo/Default.aspx
Si te he ayudado regalame Karma positivo!!!

Etiquetas: php, vb, aspx
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 10:20.