|
You need to add these lines. Why don't you read documentation?
batchTest.StartInfo.UseShellExecute = false;
batchTest.StartInfo.RedirectStandardOutput=true;
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
Try adding batchTest.StartInfo.RedirectStandardOutput = true; before you start the process.
My idea of ideal life : Eat, Sleep, Repeat
|
|
|
|
|
Thanks to both of you!
Working well now!
-= Reelix =-
|
|
|
|
|
hey there
would you mind showing me how you got it working? im trying the same thing now and i get the same error
here is my code
Process myProcess = new Process();
myProcess.StartInfo.UseShellExecute = false;
myProcess.StartInfo.RedirectStandardOutput = true;
myProcess = Process.Start("ring.exe");
Console.WriteLine("Started 1st process --> Waiting... ");
myProcess.WaitForExit();
StreamReader sr = myProcess.StandardOutput;
Console.WriteLine("Finnished 1st process ---> output:");
Console.WriteLine(sr.ReadToEnd());
thanx
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
Hi All,
I am using VS03 + c# + MS ACESS databse.
In my application i am creating a CommonConnection.cs class where i store the path of the database.
From this class i am fetching the connection all the time.
But now i want to use app.config file for setting the path of the datbase.
Please tell me how can i store the path of databse in app.config file and as well as how can i fetch the value of databse path to any form.I also want to save datbase password in app.config.
Here is my code for store the path of database.
public OleDbConnection connection()
{
OleDbConnection aConnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\\Data\\Test.mdb;Persist Security Info=True;Jet OLEDBatabase Password=san7481");
return aConnection;
}
here i am fetching the value of connectionstring in form ,from class file.
CommonConnection objCI = new CommonConnection();
private void frmIrrigationTreeSpecifications_Load(object sender, System.EventArgs e)
{
OleDbConnection aConnection = objCI.connection();
}
Thanks in advance.
|
|
|
|
|
<appSettings>
<add key="ConnectionString" value="whatever" />
string connection= System.Configuration.ConfigurationManager.AppSettings.Get("ConnectionString");
I recommend reading the article I link to in my sig, you could have easily found this info with a google search.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hello!
I am looking for some suggestions/tips for the following issue:
I have a C# Windows application having 1 form. In that form i have 12 text-boxes, 2 progress-bars, 5 buttons, status strip and 5 group-boxes.....as displayed in task manager, it is taking more than 25 MB of RAM! I haven't placed any code yet, any recommendation/tip/suggestion for the issue will be appreciated.
BTW, any idea how much RAM should it be taking?
Regards,
Adeel
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.
|
|
|
|
|
Adeel Chaudhry wrote: BTW, any idea how much RAM should it be taking?
25 MB seems fine to me. Remember, there's a residual amount of RAM before you start adding stuff. A second form won't make it 50 MB.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
I've just created an application as your description
It takes up about 3.5M at startup and always keeps below 4.5M.
Don't know why... :
|
|
|
|
|
When I try to drag one of my usercontrol onto the form, I get the following exception. But I could add the control onto the same project by opening it in mt friend's system. But coming back to my system it gives me the same error... what could be wrong in my system?
Could somebody help me in solving this issue plssssss ?????
Exception Message:
Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
Hide
at System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance(Guid& clsid, Object punkOuter, Int32 context, Guid& iid)
at System.Windows.Forms.AxHost.CreateWithoutLicense(Guid clsid)
at System.Windows.Forms.AxHost.CreateWithLicense(String license, Guid clsid)
at System.Windows.Forms.AxHost.CreateInstanceCore(Guid clsid)
at System.Windows.Forms.AxHost.CreateInstance()
at System.Windows.Forms.AxHost.GetOcxCreate()
at System.Windows.Forms.AxHost.TransitionUpTo(Int32 state)
at System.Windows.Forms.AxHost.CreateHandle()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.AxHost.EndInit()
at Orders.Orders.InitializeComponent()
at Orders.Orders..ctor()
Thanks in Advance
|
|
|
|
|
Looks like you're using a component that is not registered or not licensed on the form
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks Graus...
but I really didn,t get you.
Could you brief it...
How do I register the component...
Thanks Again..
|
|
|
|
|
I have no idea. I just see an error message with a stack trace that indicates methods are being called to use an unregistered component, and they are failing. I don't even know what component you're using, you didn't say
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks Graus...
Even though you didn't mention anything specifically in your reply.. , it helped to track the actual problem...
In fact I designed a usercontrol using some third party controls..
When I tried using my usercontrol (which was actually) designed in another system by myself) I miised to register the third party controls...
Thanks Again...
|
|
|
|
|
I've 2 internet connections
1. LAN
2. Wireless LAN
My propose is to use each LAN or WLAN connection for independent task.For example,
1. For browsing website , it will use LAN
2. For MSN, google talk ,etc., it will use WLAN.
could it possible?
thank
AJ
modified on Thursday, May 8, 2008 12:48 AM
|
|
|
|
|
What on earth does tis have to do with C# ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Being reported as Spam - Not C# Related.
-= Reelix =-
|
|
|
|
|
I need to make a small paint type program. I am relatively new to C#. However, I was wondering if someone can point me in the direction of how to make a matrix of squares so that each of the squares can have a click event. Thanks GDN
|
|
|
|
|
The obvious way to do this, is to have a single click event, and then work out what square it occured in. The alternative is to create a grid of controls, that represent your squares.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
I've noticed that when I rotate my images using matrices in C#, the image seems to be quite jagged around the borders. Is there a way to smoothen this out perhaps? I've been trying to look around on the site as well as googling (is that even a word ) with little results: the best being a tutorial for an app in C++, which sadly, is not quite the language I'm looking for in .Net! Thanks in advance, much appreciated!
|
|
|
|
|
They are jagged because of the angle of rotation. If the C++ app uses GDI+, you should be able to translate the pertinent code.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
For a program I am making, I have text in front of a picture background. As a result, the text is sometimes hard to read when the colour of the picture approaches the text colour.
As a solution to this problem, I tried making the BackColor of the textBox white, then making it semi-transparent. I tried messing around with some System.Drawing.Color methods (R, B, A, etc.) but since I am not familiar with graphics, I could'nt get it to blend properly. How can I do this?
Thanks in advance.
|
|
|
|
|
That Asian Guy wrote: As a solution to this problem, I tried making the BackColor of the textBox white, then making it semi-transparent. I tried messing around with some System.Drawing.Color methods (R, B, A, etc.) but since I am not familiar with graphics, I could'nt get it to blend properly. How can I do this?
You can't. You can only change the opacity of the entire form, not individual controls, or their backgrounds. Your alternative is to switch to .NET 3.0 or higher and use WPF to do this.
|
|
|
|