|
The following is in response to your questions:
1. What is powershell?
2. The purpose of the application is the following;
a. there is an existing console application that calls a web service. The current console app takes in various paramters to call the web service to obtain different data.
b. I am planning on the second console application calling the first console application with various sequence of commands to call.
baiscally the first console application was only setup to call a web service based upon the method number that was called.
Now i writing the second console application to call the first console application with the mehtod numbers in specific sequences.
|
|
|
|
|
dcof wrote: a. there is an existing console application that calls a web service. The
current console app takes in various paramters to call the web service to obtain
different data.
As you don't have the code for the first console application, you can't set a breakpoint in it - full stop. If you have a pdb file, you can potentially step in then, but that's it.
dcof wrote: 1. What is powershell?
This[^]
|
|
|
|
|
If the two applications are in two seperate solutions, you would need to have two copies of Visual Studio open. One to run your second project that is launching the first. You can set breakpoints in that and monitor the execution of that code.
The second one would need the debugger attached to the instance of your first console application, but can only be done AFTER it was launched. Why? Because Visual Studio is not lauching the application and therefor has no idea its even running.
I would suggest you forget doing dual-debugging for now since you don't appear to have the skill set to handle this.
Normally, you would debug the console app your code is launching seperately, using test command line parameters so you can test every little corner of your app. These command line parameters are easily supplied in the Project Properties, Debug tab of your project.
|
|
|
|
|
I just want to make certain the new console application is calling the original console application. Do you have other suggestions on how i can accomplsih my goal?
|
|
|
|
|
If you want to see if the thing launched, all you do is look in Task Manager (Ctrl-Shift-Esc) to see it when it's launched!
|
|
|
|
|
I want to write a C# 2010 application that executes a console application. This new application will send seqential commands to the console application based upon values stored in a sql server database. This new application will wait for one command to finish before the next command is executed. The commands will look like the following:
Start .\bin\Release\sample.exe parameter1 parameter2 parameter3
Due to the facts listed above, I have the following questions to ask you:
1. What type of a C# 2010 application would you set up to call the console application?
2. In this application, what would I do to make the commands get executed? Right now I type commands like I listed above in a dos command window. Do I need to add a reference to the sample.exe, do I need to obtain dll files?
Basically how would I make these commands get executed in the C# 2010 application?
|
|
|
|
|
dcof wrote: 1. What type of a C# 2010 application would you set up to call the console application?
Depends on "who" is running it. If there's no user, I'd go for a windows-service, based on the argument that your input is coming from a service. A console-app would do fine too; could be started on login, or as a service (using a tool), or using the task-scheduler.
dcof wrote: 2. In this application, what would I do to make the commands get executed?
Use the <a href="http://msdn.microsoft.com/en-us/library/e8zac0ca.aspx">Start</a>[<a href="http://msdn.microsoft.com/en-us/library/e8zac0ca.aspx" target="_blank" title="New Window">^</a>] method of the Process class, or one of the overloads.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Hi,
I have not used C# 2010 in anger but I should imagine that the methods are quite similar or the same as 2008 to make a command line call from C# I have used:
System.Diagnostics.Process.Start(@"Test.bat");
which requires the
using System.Runtime.InteropServices;
I have used a batch file in the example the as that what I used in the code but any dos command should work.
|
|
|
|
|
glennPattonWork wrote: which requires the
using System.Runtime.InteropServices;
Which is a wrong statement. The System.Diagnostics.Process class is located in the System.dll assembly and does not require any other namespace/assembly.
|
|
|
|
|
Mmmm, that's what I thought but as the dang thing didn't run and seemed to lock up and fall flat on it's face around the dos call but worked when I added the using statement I was under the impression that it had something to do with it!
Glenn
|
|
|
|
|
|
What is the benefit of using a process communicator when I can write the code in a console application?
|
|
|
|
|
dcof wrote: I can write the code in a console application
I have no idea what you mean by that. The ProcessCommunicator is for interacting with an existing console application in a programmatic way and it can be automated with the CommScript. I believe these will help you accomplish what you stated in your posts.
In your app, app instantiate a ProcessCommunicator to execute the existing console application so you can interact with it.
And you may want to instantiate a CommScript to control it.
Read the articles.
|
|
|
|
|
dcof wrote: I want to write a C# 2010 application that executes a console application....
That is about what the application does.
dcof wrote: 1. What type of a C# 2010 application would you set up to call the console
application?
That is about how the application is used. And you have provided no information about that at all.
|
|
|
|
|
Hi All,
I am try to make a program user proof (though but...) I have now got it to find the device plugged in at initial run time, it runs fine on talking to one device, closes the comm port, changes the comm port, reopens the comm port. I am trying to do this by
nameArray = SerialPort.GetPortNames();
do
{
index += 1;
cboPort.Items.Add(nameArray[index]);
}
while (!((nameArray[index] == myComPortName) || (index == nameArray.GetUpperBound(0))));
While this works fine on initial set up, it appears to work on subsequent runs but after the fourth or so run it comes up with an error mostly due I think to the fact that I am setting the serial port property with out touching the rest. <<test it="">> Well tried that did <> didn't work, I am now thinking I am trying to reassign a com port that is in use but I closed it so I should be able to??? Have I fallen foul of a security feature?
Glenn
Glenn
|
|
|
|
|
..not what you'd call a solution, but might help;
Try to put the serial-port logic in a separate console-app, and call it with the port as a parameter. If the app exits, the port "should" be free, whether you closed it nicely or not.
I hope someone else can do better
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Thanks for that, tried something like that before didn't go to well, but will give it a go
tomorrow. My understanding of the serial port class was that you could do it my way.
Glenn
|
|
|
|
|
How to extract the form of a c# FILE
|
|
|
|
|
|
I'm not sure what you want to do!
Are you talking about an .cs file?
------------------------------
Author of Primary ROleplaying SysTem
How do I take my coffee? Black as midnight on a moonless night.
War doesn't determine who's right. War determines who's left.
|
|
|
|
|
The question is unclear. However, you can always view the file in any text editor tool like notepad etc if you don't have VS installed.
|
|
|
|
|
Well,
I'm working on a software which should give rights for usergroups to a directory that is on a fileshare. The usergroup is handled in a domain on a foreign ad-server
I can create groups on this ad-server.
I can read rights of the fileshare.
I can set rights to local groups or groups of my own ad-server
But I can't give rights to groups of this other ad-server with his own domains. When I try there comes the error, that he don't know the group.
I tried to get the SecurityIdentifier and another error occurs: it says that it's not possible to translate the account.
I've tried it that way:
NTAccount account = new NTAccount("domain\\group");
SecurityIdentifier secId = (SecurityIdentifier)account.Translate(typeof(SecurityIdentifier));
This works for group of my own domain (or ad-server) but not for the foreign. Has anyone an idea what to do?
By, the way, I tried to change the Thread-User, what seems to work, but no difference:
string[] roles = { "managers", "executives" };
Thread.CurrentPrincipal = new GenericPrincipal(new GenericIdentity(user, pwd), roles);
------------------------------
Author of Primary ROleplaying SysTem
How do I take my coffee? Black as midnight on a moonless night.
War doesn't determine who's right. War determines who's left.
modified 5-Sep-12 9:05am.
|
|
|
|
|
Hello all,
On the left side of my page we have created toolstrip, with that we have panel & property grid. we have images in toolstrip when i click on the image. image goes to panel where we can large the image and assigning the values of image to property grid with these line of code.
propertyGrid1.SelectedObject = (sender as System.Windows.Forms.PictureBox);
Now my problem is when click on the image it move slightly. we want to stop that click of image. Please help me.
Thanks in advance.
Sanjeev
|
|
|
|
|
Does it actually move (change position) or does it just wait a fraction of a second before the repaint? Does the picturebox move, or the image in the picturebox?
How are the controls sized? Are they docked by any chance?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
hello everyone;
I am now learning SocketAsyncEventArgs, and i download a example from msdn.
but i do not understand one thing:
const int opsToPreAlloc = 2;
what this code meaning, why alloc 2 for buffer
thanks
|
|
|
|