473,785 Members | 2,816 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do i use C# app to reflect data on other app textbox.

Hello all,

I'm using below code for c# app to call another app

{
System.Diagnost ics.Process proc = new System.Diagnost ics.Process();
proc Enable.RaisingE vents=false;
proc StartInfo.Filen ame="anotherapp .exe" ;
proc StartInfor.Argu ments="1234";
proc Start();
}
I'm able to call up anotheapp.exe within c# app successfully but the
data (1234) that i wanted in anotherapp.exe 's inputbox is blank.

Is there any way round to achieve this condition ?

Thanks for your help .

mcl


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 15 '05 #1
2 2772
I'm not exactly sure about what you want to achieve. You are mentioning an
"inputbox". What do you mean? Do you mean a TextBox control, an instance of
TextBox class? If yes, then your other app has a GUI.

In your sample code you put the string "1234" into proc.StartInfo. Arguments.
This way you specify the command line arguments for the other app. Is the
other app a console application (without GUI)?

When you assign the value "1234" to proc.StartInfo. Arguments you specify the
command line arguments. Now when you look at the entry point of the other
app it will typically look something like this for a console application:

[STAThread]
static void Main(string[] args) {
// ... your code goes here
}

If you want to access any command line arguments, then just examine the args
string array, e.g. args[0]. You might want to check, whether any arguments
have passed at all, e.g by using args.Length:

[STAThread]
static void Main(string[] args) {
if( args.Length > 0 ) {
// access arguments with subscript, e.g. args[0].
// Sample:
string firstArgument = args[0];
}
}

For a Windows application, it typically looks like this:

[STAThread]
static void Main() {
Application.Run (new MainForm());
}

In order to receive command line parameters, modify the latter to:

[STAThread]
static void Main(string[] args) {
Application.Run (new MainForm());
}

Furthermore, if the textbox is a control on MainForm, you can write:

[STAThread]
static void Main(string[] args) {
Application.Run (new MainForm(args)) ;
}

Accordingly you would have to change the constructor for the class MainForm
so that it takes a parameter, and in the constructor you can assign your
textbox the value:

public class MainForm : System.Windows. Forms.Form {
public MainForm(string[] args) {
_theTextBox.Tex t = args[0];
}
//... other code ...
private System.Windows. Forms.TextBox _theTextBox;
}

I hope this sheds some light onto your question.

Best regards,
Manfred.
------
Manfred Lange, http://www.agileutilities.com, http://www.csunit.org

"mcl chan" <mc*****@tm.net .my> schrieb im Newsbeitrag
news:eU******** *****@tk2msftng p13.phx.gbl...
Hello all,

I'm using below code for c# app to call another app

{
System.Diagnost ics.Process proc = new System.Diagnost ics.Process();
proc Enable.RaisingE vents=false;
proc StartInfo.Filen ame="anotherapp .exe" ;
proc StartInfor.Argu ments="1234";
proc Start();
}
I'm able to call up anotheapp.exe within c# app successfully but the
data (1234) that i wanted in anotherapp.exe 's inputbox is blank.

Is there any way round to achieve this condition ?

Thanks for your help .

mcl


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 15 '05 #2
SSW
to get Arguments in anotheapp.exe use below

string[] Arguments = Environment.Get CommandLineArgs ();

To call anotheapp.exe on button1 click u need below code
private void button1_Click(o bject sender, System.EventArg s e)
{
System.Diagnost ics.Process proc = new System.Diagnost ics.Process();
proc Enable.RaisingE vents=false;
proc.StartInfo. FileName="anoth eapp.exe" ;
proc.StartInfo. Arguments="1234 ";
proc.Start();
}

HTH

sswalia
MCSD, OCA, MCAD

"mcl chan" <mc*****@tm.net .my> wrote in message
news:eU******** *****@tk2msftng p13.phx.gbl...
Hello all,

I'm using below code for c# app to call another app

{
System.Diagnost ics.Process proc = new System.Diagnost ics.Process();
proc Enable.RaisingE vents=false;
proc StartInfo.Filen ame="anotherapp .exe" ;
proc StartInfor.Argu ments="1234";
proc Start();
}
I'm able to call up anotheapp.exe within c# app successfully but the
data (1234) that i wanted in anotherapp.exe 's inputbox is blank.

Is there any way round to achieve this condition ?

Thanks for your help .

mcl


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 15 '05 #3

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

Similar topics

5
2402
by: Carlos Ribeiro | last post by:
Hello all, I'm posting this to the list with the intention to form a group of people interested in this type of solution. I'm not going to spam the list with it, unless for occasional and relevant announcements. If you're interested, drop me a note. But if for some reason you think that this discussion is fine here at the c.l.py, please let me know. ** LONG POST AHEAD **
12
2392
by: pmud | last post by:
Hi, I am using teh following code for sorting the data grid but it doesnt work. I have set the auto generate columns to false. & set the sort expression for each field as the anme of that field... This grid displayes results based on users search.. public static int numberDiv; private void Page_Load(object sender, System.EventArgs e) {
2
1612
by: MLH | last post by:
I have a form based on a table. The table has a Yes/No field. Its an A97 table. The form has a button that updates the value in the control from No to Yes for the record currently being edited. It seems the ONLY way I can make the control reflect the Yes value is to save the record. Not that its too much trouble to save it, but there are other fields whose values are going to be modifed during the instance of the current record and I...
0
1251
by: Ryan Joseph So | last post by:
Hi, I made a custom textbox control inheriting from native windows textbox. The i made another form where i used the custom control, what i want to do is to bind the data from my datatable to the textbox then when i load the data from the datatable before that data is shown in the textbox i want to format the data first so the data will show up to the textbox in the formatted style. Same when i move next or previous from my...
10
5512
by: Rigs | last post by:
Hi, I have a textbox with a Custom Validator that utilizes the OnServerValidate method for that textbox. This works fine, however the method only executes when data exists in that textbox after the Submit button is clicked. If I click the submit button and no data exists in the textbox, the OnServerValidate method does not fire. I'd like the OnServerValidate method to either execute every time the Submit button is clicked. I am...
2
6551
by: Robert Smith jr. | last post by:
Hello, Please pardon my newbie question ... I am building an ASP.NET page that displays a recordset with a Delete statement enabled (this all works fine). I want to Insert the current row *that is going to be deleted* into another table, before the original data is deleted. I am trying to use the RowDeleting method to call an Update or Insert
7
17714
Coldfire
by: Coldfire | last post by:
i am having error ....details are ASP.Net application...in which I have a textbox <asp:TextBox ID="Other" TextMode=SingleLine CssClass="serviceBox" Width="250" Height="45" Runat="server" MaxLength="1000" /></asp:TextBox> and this textbox is in a <asp:Repeater > which has the count of 35. The textbox value is stored in the SQL DB And the field data-type in the SQL DB is VARCHAR(1000)
0
1105
by: AliRezaGoogle | last post by:
Dear members, I have a datagrid and a textbox on my form. I bound both of them to a common datasource( an arbitrary datatable). When I change a text inside textbox I expect that value of same column in datagride also change and be equal to new value entered inside textbox. But this change reflects to datagrid just when I change selected row in the datagrid.
2
2455
by: ejamnadas | last post by:
I have an unbound form, whose combobox and textboxes are also unbound. The form's record source is a query (getdata) . It has combo box whose rowsource is the same query. The afterupdate event for the combobox assigns a column from the query, (Document_Control_Number), + 1, to a textbox in the form. When the form is submitted, the values are added into the table, but when I make a selection in the combobox, it does not use the updated...
0
9645
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9950
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8974
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6740
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2880
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.