|
Call the method not the variable.
cboAmplifier.Items.AddRange(GetSerialDevice().ToArray());
I added ToArray because the method is returning a List<string> but the AddRange method
expects an array[] of objects.
Your strAmplifier variable/List exists only within the socpe of the Method it was defined.
Can't use the variable outside the method where it was decalred.
Just an irritated, ranting son of ... an IT guy.
At your trolling services
|
|
|
|
|
how do i do calibration for my program, as in the user key in the setting of the program.
Thanks.
|
|
|
|
|
You may want to clarify what it is you are talking about.
|
|
|
|
|
It means that i have set my actual values in the program.But i want the user to key in values to set it.
|
|
|
|
|
I still have no idea what you are talking about. If you don't want to tell anything useful, don't expect a useful answer either.
|
|
|
|
|
With the information that you provided, about the best answer your going to get is to present a TextBox to the user and let them type whatever number required into it. Then it's your just to parse the number, validate it, normalize if necessary, yada, yada, yada, ...
|
|
|
|
|
I am trying to call a program that comverts BMP to PPM formats. The exe to do so dumps the binary contents of the conversion to the console unless redirected as such
bmptoppm.exe input.bmp >output.ppm
I am attempting to call this exe from inside a different windows forms application and save the ouput to output.ppm. I am doing so using the process class
<br />
Process myProcess = new Process();<br />
<br />
myProcess.StartInfo.UseShellExecute = false;<br />
myProcess.StartInfo.Arguments = "C:\\input.bmp";<br />
myProcess.StartInfo.FileName = "C:\\bmptoppm.exe";<br />
myProcess.StartInfo.CreateNoWindow = false;<br />
myProcess.StartInfo.RedirectStandardOutput = true;<br />
myProcess.StartInfo.RedirectStandardError = true;<br />
myProcess.Start();<br />
I am getting hung on on how exactly I can do the writing of the standardoutput to a file. Could someone point me in the right direction please?
|
|
|
|
|
do something like:
SreamReader r=null;
StreamWriter w=null;
w = myProcess.StandartInput
r= myProcess.StandardOutput
from here it's just a matter of reding the output/r and saving to a specific name/path.
|
|
|
|
|
I should have been more specific. The part of saving to a specific file name/path is where I am lacking.
|
|
|
|
|
try this:
use
string str = r.ReadToEnd();
to read the whole content of the StreamReader. Now get the bytes with something like this
byte[] rawbyte= Encoding.Default.GetBytes(str);
now write the bytes to a filestream or use custom bitmap encoding.
FileStream fs = new FileStream("yourfile.here", FileMode.OpenOrCreate);
fs.Write(data, 0, data.Length);
hope it helps.
I'm not sure if it will work. Read the conversation between me and Luc bellow for
details of how ths idea came to me.
|
|
|
|
|
do you expect binary data to survive like that? I don't know, I never did that on Windows, and everything about stdin/out/err streams seems very text oriented...
|
|
|
|
|
I don't know exactly. Maybe it works maybe not. Hence the "I hope it helps".
Actually I did something like it.
We have a tracing system in our ptoduction cells and all kind of mobile scanners.
One particular kind of those scanners used to change the project comes with off
course installers. Between the drivers there's a small utility that gets the "traffic"
to and from the scanner on the particular COM port that was asigend to.
Documentation 0 nada/rien/kaput/nothing.
The program gets the human represntation of the "traffic" meaning text.
Something like: "Sending ... to COMx. ... recieved".
I had an idea in order to make it easier to use/maintain.
But that idea ment sending the bytes to the scanner.
The technigue I mentioned => Encoding.Default.GetBytes(...) where ... is the text command worked like a charm.
Hence my maybe wrong hope of working to a larger set of data/string.
PS: I'm not a prog. An IT guy. I should put that in my signature. It's empty anyways.
|
|
|
|
|
OK thanks. I hope the OP will tell us the outcome.
|
|
|
|
|
Me too.
Just an irritated, ranting sun of an IT guy
|
|
|
|
|
|
did i spelled something wrong?
Just an irritated, ranting sun of an IT guy
|
|
|
|
|
never mind I got it. It should be son not sun.
Just an irritated, ranting sun of an IT guy
|
|
|
|
|
Wow. Responses to the dome. I will attempt it and get back.
|
|
|
|
|
I have installed this from a dozen different locations and yet when I open up VS 2010 and click file, new, website there is lots of ASP.Nets there but no MVC or MVC2. Anyone know why?
Thanks
Darrall
|
|
|
|
|
Did you use the Web Installer? I've used that on a few different machines and it's worked fine for me. Sorry, that's the most irritating answer when something doesn't work.
|
|
|
|
|
Yes...used 3 or 4 different ones The stupid thing is it says it's installed - it just isn't anywhere to be seen when you open it up. Figure something out I guess. Thanks for answering.
|
|
|
|
|
Open VS2010 ->File->New->New Project->select Language ->inside language select Web->select mvc2 ok;
if this helped you please vote me.
|
|
|
|
|
Please help me on this.
Inserting an image file to the SQL Server is not an issue for me. My problem is, I want to update the databse having an image datatype with a NULL value.
Thanks
|
|
|
|
|
The database general forum would have been a better place to ask, but
alter table [yourTable] alter column [yourColumn] image NULL
|
|
|
|
|
Hello,
How can I write a embedded resource (*.exe) in a folder?
Like this:
System.Properties.Resources.Test.exe //write in folder @(C://users/) with the name "Test.exe".
I'm using Visual Studio 2008 C#
and I'm a beginner.
Thank You very much
Boris
|
|
|
|