|
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
|
|
|
|
|
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.
|
|
|
|
|
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
Help would be greatly appreciated
thanks Wes
|
|
|
|
|
Here is a link[^] to some information on serialisation. No doubt you can find some on the other subjects.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Information on file I/O can be found here[^].
/ravi
|
|
|
|
|
hi sir,
i am doing a project for user behaviour models and i would like to make my system learn the classification based on CBR can u please share me code in c#
plz sir thanks...
|
|
|
|
|
If we give you code it's not you doing a project, is it? This is what we call cheating.
modified 5-Sep-12 4:03am.
|
|
|
|
|
Pete O'Hanlon wrote: If we give you cods Is that part of the give him a fish/teach him to fish dichotomy?
Peter
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|