|
Here's my scenario:
I want a client application to connect to my webservice and request a particular file, which I'll stream down to them.
Client would then save to disk on their side.
Returning a byte[] seems the best option, but I'm not too sure how to get the encoding right so the resultant file is still valid.
The files in question would be binary.
Anyone done this?
Cheers,
Simon
"I ask candidates to create an object model of a chicken.", Bruce Eckel on interviewing programmers.
animation mechanics in SVG (my first abstract photo)
|
|
|
|
|
|
There is a text editor I like to use on Linux called Kate, part of KDE. It has a nice feature where you can have a command prompt in a frame, and the command prompt "follows" the document you are currently editing.
I was thinking it would be nice to have something like this on Windows. But I can't see any way to embed a command prompt in a C# Windows Form.
Does anyone know if this is possible, and if so how to do it? Any ideas?
|
|
|
|
|
imoz wrote:
Does anyone know if this is possible, and if so how to do it? Any ideas?
Yes, see the documentation for the System.Diagnostics.Process; probably there are samples for this on the Internet already.
You'll need to provide alternate input/output StreamWriters on the StandardOutput and StandardInput properties, redirecting it to where you may want.
Kant wrote:
Actually she replied back to me "You shouldn't fix the bug. You should kill it"
|
|
|
|
|
Hi there,
Thanks for the tip. I was able to track down some samples. I am able to start a cmd.exe process w/ no window. However, if I put a textbox on my windows.form, and setup an event handler for the KeyPress event, it hangs when I try to write e.KeyChar to the stream.
Joe Mozelesky
:: powered by imoz ::
"Luck is the result of preparation and opportunity."
|
|
|
|
|
imoz wrote:
Hi there,
Thanks for the tip. I was able to track down some samples. I am able to start a cmd.exe process w/ no window. However, if I put a textbox on my windows.form, and setup an event handler for the KeyPress event, it hangs when I try to write e.KeyChar to the stream.
Maybe the process isn't waiting for a char at the moment you sent the key to its input stream.
One thing I would try would be using a buffered stream or a separate thread that read the chars from a queue.
Kant wrote:
Actually she replied back to me "You shouldn't fix the bug. You should kill it"
|
|
|
|
|
Hi,
I like to create something like the explorer tree. This treeview structure contains more than one node type (drives, systemcontrol, network). Each node type has it's own behaviour, and has to be handled different. Letz say some content are the drives of the local machine, but another node type represents no disk drive (e.g SystemControl) that is handled different as if you click on a drive node.
How to handle stuff like that? The goal should be to reuse my node handler's, so i don't like to implement all the stuff in one special treeview class. I guess i have to write something like NodeHandler's, which only handles the events from the node type it made for.
For my explorer view i would have 3 NodeHandlers, one for drives, one for systemcontrol and one for network, right ?
if you know a good pattern to handle this, please let me know
.:[Greets from Jerry Maguire]:.
|
|
|
|
|
I would like to draw text with a OPAQUE or TRANSPARENT backgound mode.
How to do that with GDI+?
In other terms, under GDI+, how to obtain an effect similar to the SetBkMode and SetBkColor functions of GDI?
|
|
|
|
|
hi there,
Just a quickie:
Are there classes around to directly convert a 4byte big byte array to an Int32, or do I need to go the manual way?
Thanks a lot,
stonee
|
|
|
|
|
byte bt=0;
int i = Convert.ToInt32(bt);
MessageBox.Show(i.ToString());
switch(twinsOnWay)
{
case ("twins on the way"):
MessageBox.Show("for mr and mrs dynamic","twins on the way");
break;
|
|
|
|
|
i am talking about a byte array consisting of 4 bytes!
thanks,
stonee
|
|
|
|
|
have you checked out Convert Class,
it offers great varieties
|
|
|
|
|
found a solution with the
System.BitConverter.ToInt32(mybyteArray,4);
thanks anyway,
stonee
|
|
|
|
|
Hey,
I have a Windows form apllication with form1 and form2.
Form1 :
Combobox1 : bind to a dataset and have a displaymemeber
and valuemember.
Button1 : to go to form2 and also save the
combobox1.selectedvalue in a static variable string (ex.
val).
Form2 :
Combobox2 : bind to the same dataset, dislaymember and
valuemeber like combobox1 (When i checked it have the
same contents like combobox1).
But here I want to set the selectedvalue = val (the
selectedvalue of Form1.combobox1 saved in memory).
I'am sure that combobox2 have a selectedvalue=val.
But after combobox2.SelectedValue = val; The
selectedvalue of combobox2 stays null.
I don't know why.
Somebody knows the reason?
Set the selectedvalue of a combobox works fine, if i stay
on the same form, with the same combo. (So the combo is not constructed in the initialisecomponent again)
Nic
|
|
|
|
|
I Founded (after a several houres).
Fault was I bound the data and valuemebers in de initialisecomponent. It must be in the constructor !!!!
|
|
|
|
|
Hey,
In a Windows Form I access the assembly as follows :
Assembly assem = this.GetType().Assembly;
foreach(string resourceName in assem.GetManifestResourceNames(){
...
}
How I have to do that in a console application? This application have only a Main.
In the Main you cannot use this (because Main is static).
But I will do the same thing like in the windows forms.
Thanks for the hints,
bell
|
|
|
|
|
Is there a way to manually remove a file lock?
|
|
|
|
|
A question concerning the behavior...
Ex. I bind the data to a DataSet in the Form_Load() event. I have an event that is triggered when on the SelectedIndex_Changed event. On the load, the DataBind is causing the SelectedIndex event to fire which sort of makes sense. Is there flag or property I can set around the code block which binds the data to force it not to trigger that event.
|
|
|
|
|
There's no flag like this, I think. Create Your own - or - disconnect handler before DataBind and connect it after loading data
Hi,
AW
|
|
|
|
|
It is because.first u are seting the data source and then u might be setting the dispaly member and value member....
u can do like this
cmbClassId.DisplayMember = dataSet.Tables[Constants.CLASSES].Columns["ClassName"].ToString();
cmbClassId.ValueMember = dataSet.Tables[Constants.CLASSES].Columns["ClassID"].ToString();
cmbClassId.DataSource = dataSet.Tables[Constants.CLASSES];
This will cause event to occure only once.
dipak
|
|
|
|
|
To make a long story short, I've had to reinstall the directX 9 SDK. Im having trouble though actually finding the .dll files I need to use however (Microsoft.DirectX.Direct3D.dll etc). In my C:\WINDOWS\Microsoft.NET\Managed DirectX\v4.09.00.0900 directory, I have all of the .dll files I have used before however for files like Microsoft.DirectX.Direct3D and Microsoft.DirectX.Direct3DX, which I havent used before, all I has is their .xml files (no .dlls). I know .xml files arent "executable" but I have a suspicion I can create the .dll files from the .xml files. Any ideas?
I dont know, this whole thing has me pretty confused. Ive uninstalled and reinstalled the sdk a few times now, and cannot figure out where its putting all those files. I dont remember having this problem the first time I installed the sdk, and now everything just seems to be messed up. Any ideas?
Thanks
Dave Ratti
|
|
|
|
|
All right nevermind, I seemed to have fixed it. I installed DirectX 9a and now all my .dll files are there. Still very weird though.
|
|
|
|
|
Is there any Hungarian Notation for C#?
Never take a problem to your boss unless you have a solution. This signature was created by "Code Project Quoter".
|
|
|
|
|
|
I think MS has done away with Hungarian notation for C# and other .Net languages. See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconnamingguidelines.asp?frame=true
|
|
|
|