473,406 Members | 2,633 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

I want to compile and run our simple c# from our winform

We compile our program from process.start that compiled but after compilation don't create an exe file

if thats programe compile from cmd then exe file is generate
Expand|Select|Wrap|Line Numbers
  1. Process ps = new Process();
  2.                 ps.StartInfo.FileName = "C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\csc.exe";
  3.                 ps.StartInfo.Arguments = "D:\program.cs"
  4.                 ps.StartInfo.UseShellExecute = false;
  5.                 ps.StartInfo.RedirectStandardOutput = true;
  6.                 ps.Start();
  7.                 ps.WaitForExit();
  8.                 Result_txt.Text = ps.StandardOutput.ReadToEnd();
  9.  
  10.  
  11.  
  12. string exe_file = fi.FullName.Remove((fi.FullName.Length - 3), 3) + ".exe";
  13.                 if (File.Exists(exe_file))
  14.                 {
  15.                     ps = new Process();
  16.                     ps.StartInfo.FileName = exe_file;
  17.                     ps.StartInfo.UseShellExecute = false;
  18.                     ps.StartInfo.RedirectStandardOutput = true;
  19.                     ps.StartInfo.RedirectStandardInput = true;
  20.                     ps.Start();
  21.                     Result_txt.Text += ps.StandardOutput.ReadToEnd();
  22.                     ps.WaitForExit();
  23.                 }
  24.  
Jul 16 '19 #1
1 1243
DANILIN
24 16bit
in Russia compile using bat:

inside folder
C:\Windows\Microsoft.NET\Framework64\v4.0.30319
attention: Framework ... 64

bat for windows c#:

Expand|Select|Wrap|Line Numbers
  1. csc.exe /target:winexe program.cs
  2. pause
bat for dos c#:

Expand|Select|Wrap|Line Numbers
  1. csc.exe /nologo program.cs
  2. pause
I hope it helps to shape your start
Sep 14 '19 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: robert | last post by:
hi! I want to have a custom button change appearance when pressed and then call a function and change back to its original appearance when released. here's what i have now, which works mostly....
0
by: Tom | last post by:
when developing winform and you have alot of options either from toolbar or menu... how does one work at it during design time ? do you put the controls for different selections in panels and...
13
by: Mtk | last post by:
Hi! Why does the following, simple, example produce such errors? I know it has to do with the two header files including each other and (moreover) the usage of the classes One and Two in the...
17
by: MLH | last post by:
After running the following code snippet... MyURL = "http://tycho.usno.navy.mil/what.html" msXML.Open "GET", MyURL, False msXML.send I would like to execute code to perform essentially what...
6
by: Joachim | last post by:
I have the following simple program: #include <iostream> #include <map> #include <string> #include <sstream> #include <fstream> #include <vector> using namespace std;
2
by: Keith A. Rowe | last post by:
I have developed apps on scores of platforms for 25 years. Each of these platforms have supported a "quick, but not so dirty" utility for code table maintenance. For example, I have a States...
3
by: | last post by:
I am trying to compile a simple c# class in Web Matrix called howdy.cs: // Program start class public class HowdyPartner { // Main begins program execution public static void Main() { //...
15
by: key9 | last post by:
Why still can't compile (simple) Hi all I have nothing to say , the code still can not be complie, where's problem? ========================================= //test.cpp #include <stdio.h>...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.