|
I have recently written something similar to you Data Server, and it works as follows. In the main thread I spawn a new thread which just listens (using TcpListener ) for incoming TCP connections.
When a new connection arrives the TcpListener passes a Socket object on the way out of AcceptSocket . I pass this socket to a ThreadPool worker thread which will handle the rest of the communication for that connection, meanwhile the listener thread loops back and waits for another socket connection. That provides a straight-foward multithreaded server approach - the server can communicate with several clients at the same time with each conversation in isolation from the others.
As far as the client goes, that should be just straight forward socket stuff using either Socket or TcpClient .
It's gone midnight here and I'm going to bed, but if you'd like me to send some sample source code through drop me a line and I'll do it tomorrow.
Rob Philpott.
|
|
|
|
|
Hi out there,
I try to add an new column to a ListView at runtime. When I initial the ListView everything works perfectly. But when I use:
ListView.Columns.Add("SomeText",-2,HorizontalAlignment.Center);
within the programm nothing happens. Even if I add an update or refresh argument.
Any ideas?
thx for your support.
woops00
|
|
|
|
|
Hi Gurus,
Please help me, i am looking for the best solution for reading mails from exchange server. I have gone through two technologies right now, one is MAPI and the other is WEBDAV. With MAPI, i have one confusion; Do i need Microsoft Outlook installed on my machine for using MAPI? Please tell me some good articles for that. We are not permitted to install OUTLOOK on the server. Also i am looking for some good articles on WEBDAV. Looking for the best solution !!
Thanks,
Sumit
|
|
|
|
|
Presently i am able to read the bios but not the Fanspeed of the CPU.Can anyone help to do so ie the speed of the CPU fan from bios.
Ajai
|
|
|
|
|
Same question from me also..
Is it possible ??
|
|
|
|
|
Hai All,
I Have to use a dll that is compiled in delphi 5.
Can it be used directly in the COM.
I am new to Com programming.
Actually if the dll generated in the Delphi is compatable i have to use it in my .net environment by writing a wrapper class.
Please help me.
sukanyavarma
|
|
|
|
|
May be worth asking in a Delphi forum? Chances are that it should be possible, as Borland have Delphi .NET and I'd guess it will have features to interoperate with legacy Delphi code.
Kevin
|
|
|
|
|
Is there any way to make Digitally signed emails and recipient can verify through Digital ID of sender in .NET?
R A M
|
|
|
|
|
Hi,
This is problem about Image processing.
let me describe whole situation.
We are working on project of image processing(talking about OMR).
In that image there are multiple answers and we have to find out which answer is marked and which is not marked out of four answers and for that we are doing recognisation(OMR).
Here marked answers are in pencil colors.
In this project we are using colored image(one image is having one color) and from that colored image we are filtering particular color by drawing rectanlge on one color and that color should be dropped out from the whole image so after that filtering we can get good results of marked answers.
For filtering the colors we had made one algorithm which find out what is MinR,MaxR,MinG,MaxG,MinB,MaxB of that rectangle for which u are dropping colors.
Now problem is that,while finding out Min. values of R,G,B we are getting values of Pencil colors also into that Min. R,G,B (although we had selected color like purple,in that purple color some pencil colors are also there ) and if i am tring to removing from Min. to Max range of those selected rectangle color then pencil colors are also removing so marked answers are also removed and due to that recognisation is not doing properly.
I hope you understand the problem.
Pls. help me out.
Thanks in advance.
montu3377
|
|
|
|
|
No, I don't really understand the problem.
What are the "colored images"? Are you separating the image into RGB colour channels?
Where are you drawing the rectangle? What do you mean by dropping a color?
What are the minimum and maximum values for? How are they calculated?
---
b { font-weight: normal; }
|
|
|
|
|
I have a form with several text boxes and i want the entry in each form to populate a seperate row in my database table , is there a way to do this?
remiodufuye
|
|
|
|
|
hi,
i'm using Component One TrueDBGrid in my form.
one of the columns is the "Amount" field. ItShould allow users to enter only integers or float type. But if he attempts to enter characters, error provider should be shown..this will be done in RowColChange event of the grid...so he shuld not be able to enter any characters or special characters..
Please tell me how i'll do this...i tried using the EditMask property of the grid i.e.
tdbgridOnewayReturn.Splits[0].DisplayColumn[3].DataColumn.EditMask = "0000000.00";
but this doesn't take decimal..if i enter 0000332.99, then it saves as 3329900..which is not correct.
But if i use NumberFormat property of the grid :
tdbgridOnewayReturn.Splits[0].DisplayColumns[3].DataColumn.NumberFormat = "Fixed";
then,the user can also enter characters..which is not correct..
please do tell me how i'll resolve this problem....
thanx ..
|
|
|
|
|
I am having trouble writing an arraylist in the console. Below is the code, I believe everything is working well, but I have no way of writing the array. Any help would be appreciated!
using System;
using System.Collections;
public class PrimeFinder
{
public static void Main()
{
// Creates and initializes the prime number array
ArrayList primeNumbers = new ArrayList();
for(int i = 2; i < 100; i++)
{
bool divisible = false;
foreach(int number in primeNumbers)
if(i % number == 0)
divisible = true;
if(divisible == false)
primeNumbers.Add(i);
}
// Display the prime number list
}
}
|
|
|
|
|
Is this what you need ?
foreach(int num in primeNumbers)<br />
Console.WriteLine(num );
|
|
|
|
|
>>created a checkbos and a button like this:
CheckBox checkBox2 = new CheckBox();
checkBox2.Text="Test";
checkBox2.Location = new System.Drawing.Point(16,64);
//create the button
btnPF.Text="Create";
btnPF.Location = new System.Drawing.Point(208,208);
btnPF.Click += new System.EventHandler(btnPF_Click);
>> on the event I place this code
if(checkBox2.Checked==true)
MessageBox.Show("checked","Info";
else
MessageBox.Show("Not checked","Info");
>>problem, even if the box is checked, the message is always "Not Check"
>>Any help is greatly appreciated
|
|
|
|
|
First, you don't need the first 8 lines of code you posted, it's automatically generated by the VS.NET designer, and the default control code is generated by double-clicking the control in the designer view. Other than that, the control should read something like this:
<br />
public void btnPF_Click(object sender, EventArgs e)<br />
{<br />
if (checkBox2.Checked)
{<br />
MessageBox.Show("Checked", "Info");
}<br />
else<br />
{<br />
MessageBox.Show("Not checked", "Info");<br />
}<br />
}<br />
So, in short, use the VS.NET designer to generate any code except for the code inside the main scope in the code above (the '{}' that is opened first and closed last), using the the drag and drop to the designer method to make the controls, and double-clicking them to add code to them.
|
|
|
|
|
Thank you jamac7142;
I did not explained correctly so let me try again:
I have one button (btnCreate)on form, when it is clicked, it creates three components, a panel, checkbox and another button (btnPF). When the new button (btnPF)is clicked, it checks if the checkbox is checked or not.
So the 8 lines are part of the first button (btnCreate).
|
|
|
|
|
Try this then:
<br />
private void btnCreate_Click(object sender, EventArgs e)<br />
{<br />
Panel panel1 = new Panel();<br />
CheckBox cB1 = new CheckBox();<br />
Button btnPF = new Button();<br />
<br />
<br />
panel1.Location = new Point(x,y);<br />
panel1.Size = new Size(x,y);<br />
<br />
cB1.Location = new Point(x,y);<br />
cB1.Size = new Size(x,y);<br />
cB1.Text = "checkBox";<br />
<br />
btnPF.Location = new Point(x,y);<br />
btnPF.Size = new Size(x,y);<br />
btnPF.Text = "button";<br />
<br />
Controls.Add(panel1);<br />
Controls.Add(cB1);<br />
Controls.Add(btnPF);<br />
<br />
this.btnPF.Click += new System.EventHandler(this.btnPF_Click);<br />
}<br />
private btnPF_Click(object sender, EventArgs e)<br />
{<br />
if (cB1.Checked)<br />
{<br />
MessageBox.Show("Checked", "Info");<br />
}<br />
else<br />
MessageBox.Show("Unchecked", "Info");<br />
}<br />
-- modified at 0:16 Saturday 29th October, 2005
|
|
|
|
|
You code is just like mine with the exception of the line adding the controls:
panel1.Controls.AddRange(new Control[]{cB1,btnPF});
I changed to your sugetion, just incase
// Add them:
Controls.Add(panel1);
Controls.Add(cB1);
Controls.Add(btnPF);
but
Still no luck.
somehow does not like the "if (cB1.Checked)...."
it alsways displays the message under "else"
|
|
|
|
|
Try this:
<br />
if (checkBox1.Checked)<br />
{<br />
MessageBox.Show("Checked");<br />
}<br />
else<br />
{<br />
MessageBox.Show("Unchecked");<br />
}<br />
|
|
|
|
|
Thank you jmac7142 for helping me troubleshoot this problem.
An tried the MessageBox as you suggested.
still no luck.
I am planning to use about five checkboxes but I can even make it work with one. May be I should the "switch" insted of the "if-else"
|
|
|
|
|
My last post worked on my machine though...
|
|
|
|
|
Guessing from your recent question about the NullReferenceException, could it be that you've messed up the controls you're working with, i.e. create one CheckBox and then test the wrong one for its Checked state?
You don't have to try switch instead of if-else, they're completely equivalent and will definitely not be the reason for your problem.
Try setting a breakpoint at where you query your CheckBox and take a look at its properties. Perhaps you can find the reason there.
Regards,
mav
|
|
|
|
|
How to solve viewing images with zoom in C# like in very common graphic editors? There you just open an image, and then view desired detail of an image (using Magnyfying glass tool). When you zoom it in, you see pixelated part of image and smaller scroll bars, so you are still able to move image.
In C#, when I try to stretch 3 megapixel image to 800%, an ugly memory problem appears. Why? I'm not resizing the image, just stretching PictureBox to see zoomed image. But this technique doesn't work. Does anybody know how to solve this? I'm lost with this task
|
|
|
|
|
Hello,
I'm trying to read data from a binary file with multiple resources that each have their own header, containing the distance to the next resource header as well as a uInt32 that needs to be read. My question is this: is it possible to read data from each resource header, keeping in mind that since this is a file type in general, and the distance to the next resource will be different for each file or resource that the user opens.
Thanks in advance.
|
|
|
|