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.
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[^]
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!
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.
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();
index += 1;
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?
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:
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.
This expression is just creating a constant value which will be used elsewhere in the code. It is not clear from the above what it will be used for, you need to check the actual references to opsToPreAlloc.
One of these days I'm going to think of a really clever signature.
It appears to be used to define the maximum size of the buffer in the BufferManager class defined here[^]. In the sample[^] you are using, it's the number of allowed connections multiplied by the size of the receive buffer multipled by 2. In other words, it allows you to have bytes for both reads and writes.
*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington
Hi all, im a junior programmer, writing my exam now in 3days on Microsoft Course 2956B, just would like to know if anyone has any tutorials or pdf's on "Monitoring and Debugging Applications", "Reading and Writing Files" and "Serializing Data" these the only modules im kinda battling with