Ver Mensaje Individual
  #6 (permalink)  
Antiguo 03/04/2012, 21:24
Avatar de Aquaventus
Aquaventus
 
Fecha de Ingreso: junio-2010
Ubicación: Lima-Peru , En el alba de la naturaleza
Mensajes: 2.105
Antigüedad: 13 años, 10 meses
Puntos: 267
Respuesta: como exportar de c# web a xml

Hola rrecarte puedes usar esta página para convertir vb.net a c# y viceversa :
VB.NET to C#.

Codigo traducido :
Código C:
Ver original
  1. //La variable texto es el contenido a pasar al xml, y nombre_archivo es SOLO el nombre que le queremos asignar
  2. private void crear_escribir_XML(string texto, string nombre_archivo)
  3. {
  4.     //Creo un StreamWriter
  5.     StreamWriter sw = null;
  6.     //Obtengo la ruta donde se creará el archivo
  7.     string pathFile = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase.ToString()).Remove(0, 6) + "\\" + nombre_archivo + ".xml";
  8.     //Creo el archivo
  9.     sw = File.CreateText(pathFile);
  10.     //Lleno el archivo con el contenido
  11.     sw.Write(texto);
  12.     sw.Flush();
  13.     //Cierro el proceso
  14.     sw.Close();
  15.     //Libero recursos
  16.     sw.Dispose();
  17. }
__________________
Internet es tener todo el conocimiento global a tu disposición.
Desarrollo de Software - Ejemplos .Net