Pregunta? creo que imposible o no?( compilar)

03/11/2003 - 04:38 por Miutarg | Informe spam
HOLA A TODOS, SERA QUE UNO PUEDE MANDAR A GUARDAR UN
ARCHIVO DE TEXTO CON
FORMATO .CS Y LUEGO COMPILARLO ASI COMO SE HACE DESDE
MSDOS PERO DESDE UN
FORMULARIO?

OSE ES ALGO ASI COLOCAR UN BOTON Y UN RICH TEXTBOX

DIGAMOS QUE EN EL RICH TEXBOX SE COLOCA ESTO

class HolaMundo
{
static void Main()
{
System.Console.WriteLine("¡Hola Mundo!");
}
}

LUEGO AL PRECIONAR EL BOTON SE GUARDE CON ESTENCIAON .CS
Y SE COMPILE PARA EJECUTAR EL MSDOS Y SALGA EN CONSOLA
HOLA MUNDO

YA TENGO CASI TODO LISTO LO QUE ME FALTA ES BUSCAR LA
FORMA DE QUE ME
COMPILE EL ARCHIVO .CS Y SALGA EN LA CONSOLA ( YA ESTO
QUE ME ABRA EN MSDOS
LO SE HACER)

EN LO QUE HE INVESTIGADO ENCONTRE CON UNA CLASE QUE PUEDE
COMPLILAR System.CodeDom.Compiler PERO NO LO SE UTILIZAR
NI REMOTA IDEA DE COMO HACER.

ESPERO SU RESPUESTA
GRACIAS DE ANTE MANO
 

Leer las respuestas

#1 Fran Arreciado [MS]
03/11/2003 - 20:12 | Informe spam
Hombre, puedes abrir un shell para que ejecute el compilador de c#
(csc.exe). Al estar incluido en la maquina como parte de .Net Framework, su
presencia es segura.

Recuerda que tendrás que incluir el path completo a csc.exe. Te copio las
opciones debajo

Ya nos cuentas !!

Un saludo,
Fran

Este mensaje se proporciona "como está" sin garantías de ninguna clase, y no
otorga ningún derecho

D:\Documents and Settings\usuario\Desktop>csc /?
Microsoft (R) Visual C# .NET Compiler version 7.00.9466
for Microsoft (R) .NET Framework version 1.0.3705
Copyright (C) Microsoft Corporation 2001. All rights reserved.

Visual C# .NET Compiler Options

- OUTPUT FILES -
/out:<file> Output file name (default: base name of file with
main
class or first file)
/target:exe Build a console executable (default) (Short form:
/t:exe)
/target:winexe Build a Windows executable (Short form: /t:winexe)
/target:library Build a library (Short form: /t:library)
/target:module Build a module that can be added to another assembly
(Short form: /t:module)
/define:<symbol list> Define conditional compilation symbol(s) (Short
form:
/d)
/doc:<file> XML Documentation file to generate

- INPUT FILES -
/recurse:<wildcard> Include all files in the current directory and
subdirectories according to the wildcard
specifications
/reference:<file list> Reference metadata from the specified assembly files
(Short form: /r)
/addmodule:<file list> Link the specified modules into this assembly

- RESOURCES -
/win32res:<file> Specifies Win32 resource file (.res)
/win32icon:<file> Use this icon for the output
/resource:<resinfo> Embeds the specified resource (Short form: /res)
/linkresource:<resinfo> Links the specified resource to this assembly (Short
form: /linkres)

- CODE GENERATION -
/debug[+|-] Emit debugging information
/debug:{full|pdbonly} Specify debugging type ('full' is default, and
enables
attaching a debugger to a running program)
/optimize[+|-] Enable optimizations (Short form: /o)
/incremental[+|-] Enable incremental compilation (Short form: /incr)

- ERRORS AND WARNINGS -
/warnaserror[+|-] Treat warnings as errors
/warn:<n> Set warning level (0-4) (Short form: /w)
/nowarn:<warning list> Disable specific warning messages

- LANGUAGE -
/checked[+|-] Generate overflow checks
/unsafe[+|-] Allow 'unsafe' code

- MISCELLANEOUS -
@<file> Read response file for more options
/help Display this usage message (Short form: /?)
/nologo Suppress compiler copyright message
/noconfig Do not auto include CSC.RSP file

- ADVANCED -
/baseaddress:<address> Base address for the library to be built
/bugreport:<file> Create a 'Bug Report' file
/codepage:<n> Specifies the codepage to use when opening source
files
/utf8output Output compiler messages in UTF-8 encoding
/main:<type> Specifies the type that contains the entry point
(ignore
all other possible entry points) (Short form: /m)
/fullpaths Compiler generates fully qualified paths
/filealign:<n> Specify the alignment used for output file sections
/nostdlib[+|-] Do not reference standard library (mscorlib.dll)
/lib:<file list> Specify additional directories to search in for
references







"Miutarg" wrote in message
news:064601c3a1bb$fbb84660$
HOLA A TODOS, SERA QUE UNO PUEDE MANDAR A GUARDAR UN
ARCHIVO DE TEXTO CON
FORMATO .CS Y LUEGO COMPILARLO ASI COMO SE HACE DESDE
MSDOS PERO DESDE UN
FORMULARIO?

OSE ES ALGO ASI COLOCAR UN BOTON Y UN RICH TEXTBOX

DIGAMOS QUE EN EL RICH TEXBOX SE COLOCA ESTO

class HolaMundo
{
static void Main()
{
System.Console.WriteLine("¡Hola Mundo!");
}
}

LUEGO AL PRECIONAR EL BOTON SE GUARDE CON ESTENCIAON .CS
Y SE COMPILE PARA EJECUTAR EL MSDOS Y SALGA EN CONSOLA
HOLA MUNDO

YA TENGO CASI TODO LISTO LO QUE ME FALTA ES BUSCAR LA
FORMA DE QUE ME
COMPILE EL ARCHIVO .CS Y SALGA EN LA CONSOLA ( YA ESTO
QUE ME ABRA EN MSDOS
LO SE HACER)

EN LO QUE HE INVESTIGADO ENCONTRE CON UNA CLASE QUE PUEDE
COMPLILAR System.CodeDom.Compiler PERO NO LO SE UTILIZAR
NI REMOTA IDEA DE COMO HACER.

ESPERO SU RESPUESTA
GRACIAS DE ANTE MANO

Preguntas similares