|
Okay... it's been a while since i last posted a question here, but... now i ran into biiiiig problems.
The problem i have to solve is somewhat like this:
I have to design an UI which is similar to the one in Windows messenger(basic funcionality - only to send messages and files) through a local area network. Every computer on the network will have this program installed and i will have one server to configure and to transmit messages. the happy part of the problem is that the server is not my responsibility...
So ... i drag a few textboxes, buttons... and i have the User Interface. I enable drag&drop for the textboxes (just like in Y!M) and... now comes the problem(s).
How do i transmit the messages to the server (identified by an IP), maybe through some port? The message format is not one of my concerns, but... i guess sending data unencrypted over the web is not such a good thing (so i would need a way to encrypt data).
How do i listen to some ports of the LAN for incoming messages from the server?
How do i send files over the IP protocol? I think it is all about a transaction, but i have never done anything like this before (oh, i did! ... but that was on a ... serial port!).
Thanks a lot for even trying to understand me!
Any other ideas would be appreciated!
Thanks a lot again!
|
|
|
|
|
I create help file in Help workshop.
The help file extension is .hlp. Now I want to use that file in C#.Net project with the help of help provider. I want to call that .hlp file.
when pressing F1 key.
How can i do
Please help me out
|
|
|
|
|
See if you could use System.Windows.Forms.Help.Show()
SkyWalker
|
|
|
|
|
it will work if i press f1 key
|
|
|
|
|
I am wanting to use a button on a form as a start/stop button for a piece of code. I could put the piece of code in the click function for the button, but is there a better way of achieving this? Via a object of another function? If so how would I trigger the start stop? Please give a code example.
Thanks in advance.
|
|
|
|
|
Well, my idea would be to use a variable: bool a; ... in the mouse_click event you write:
if(a == true) {function_call(var1);}
else {function_call(var2);}
i did not quite get it what you were doing, but... if that is what you were doing, sorry. in another way i don't know.
|
|
|
|
|
Thanks, but I don't think this is what I want.
I want the code that is started (with the start button) to run continuously (loop within the code) until the stop button is pressed.
Thanks
|
|
|
|
|
You may use a thread and in the start method of the thread you put your code and when clicking on the strat button you start the thread and you stop it when clicking on the stop button.
if you can provide us some code of yours we may help more.
good luck
|
|
|
|
|
Use a BackgroundWorker and set it to accept cancellation.
SkyWalker
|
|
|
|
|
Thanks BackgroundWorker looks right for the job !!!
|
|
|
|
|
Super
SkyWalker
|
|
|
|
|
hi all,
i have a question.How can i set a time limit in a thread. Example,i have a thread which will implement a action(A),what i want is the action(A) will abord or stop after 5 second even it haven complete its job.
any hits are welcome,
thanks in advance
cocoonwls
|
|
|
|
|
Maybe set the timer to run for 5000 milliseconds and then have the thread terminate? Just a quick thought
|
|
|
|
|
|
hi,
thanks..
You have gave me an idea to implement it;)
|
|
|
|
|
Have a sample.xml with ten lines. Iam looking for the 3rd line or the line with the tags <system>.
how can I read what is between a tag, for example
<system>unknown
I tried this code
******************
XmlTextReader reader = new XmlTextReader ("c:\\sample.xml");
while (reader.Read())
{
switch (reader.NodeType)
{
case XmlNodeType.Text:
listBox1.Items.Add(reader.Value);
break;
*************************
but it list all of the values
thanX in advanced
|
|
|
|
|
The message supposed to read with the tags "SYSTEM"
for example "<system1>"unknown""
|
|
|
|
|
You'd need to post the XML, but, broadly, you should not read XML by counting lines, but by using XPath ( there's a clue, go and google XPath ).
The XmlDocument class is what you want to use to search Xml documents.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
use XmlDocument...
XmlDocument xd= new XmlDocument();
xd.load(@"x:\x.xml");
// then
xd.getElementsByTagName();
any thing u can do....
|
|
|
|
|
Hi there! I've an application in which I use Microsoft Office Document Imaging component to read scanned files(tiff format). Sometimes file can not be read by OCR so exception occurs I've put that block in try-catch block. Now to the real problem which does not occur always and on all the files or on all the systems. Sometimes while reading the tiff files "Object reference not set to an instance of an object" problem occurs. Bigger problem is that it does not occur in debugging mode but while testing the exe. My most of the code is inside try-catch block. So my question is can I trace error like inside a web appication(Application_onError) and trace the exact point where error occurs. Any help would be higly appreciated.
Thanks in advance.
Don't Quit
|
|
|
|
|
I am new to programing in general and I am doing my best to learn C#. In working on my current self invented project i have ran into a problem, I need to control what characters can be entered in a text box. I want to only allow the # 1-9 if that helps. thanks in advance for any suggestions.
|
|
|
|
|
This is a common question, but the solution is a little complex, at least for a beginner. The answer is to handle the KeyPress event for the control, and to check if the key is what you want, or to reject it. Setting Handled to true on the event args rejects the keypress, so the code is something like:
e.Handled = ! ( Char.IsNumeric(e.KeyChar) || Char.IsControl(e.KeyChar));
No warranty expressed or implied on the above line, it's a guess
Or you can use a masked edit control.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Thank you, Makes sense however i get this message when i input the code... System.EventArgs' does not contain a definition for 'Handled' once again i am sure this would be something easily fixed by someone with moderate experience. Any help would be appreciated
|
|
|
|
|
EventArgs is a base class, the KeyPressed event gets passed KeyPressedEventArgs. I may be wrong it may be the KeyUp event that you need to handle.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
i added the EventArgs class, It didn't do anything. So i need to define "handled"
this
e.Handled = ! ( Char.IsNumeric(e.KeyChar) || Char.IsControl(e.KeyChar));
I'm terribly confused, but the good news that generally happens right before i begin to understand everything. So in this case what is "Handled" a method field or a constructor? and what do u recommend i do about defining it?
-- modified at 22:51 Friday 2nd February, 2007
Ok never mind i need to place this code inside a method thats tied to an event but the same problem still exists and im not all that sure of how to write that method.
|
|
|
|