|
Hi to all,
Plz, help to develop UDP in C# using Winsock Library. From where I can get a sample code to develop UDP using Winsock Library in C#.
I have develop the code, but it failed to receive data in following code,
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using MSWinsockLib;
using AxMSWinsockLib;
using System.Net;
using System.Net.Sockets;
namespace @as
{
public partial class Form1 : Form
{
WinsockClass winSockCls;
Object data;
String str;
public Form1()
{
InitializeComponent();
data = new Object();
winSockCls = new WinsockClass();
winSockCls.Close();
winSockCls.DataArrival += new MSWinsockLib.DMSWinsockControlEvents_DataArrivalEventHandler(Socket_DataArrival);
}
private void Form1_Load(object sender, EventArgs e)
{
winSockCls.Protocol = MSWinsockLib.ProtocolConstants.sckUDPProtocol;
winSockCls.RemoteHost = "192.168.0.6";
winSockCls.RemotePort = 12345;
winSockCls.LocalPort = 8080;
str = "Hi Ani";
winSockCls.SendData(str);
}
private void Socket_DataArrival(int bytesTotal)
{
if (winSockCls.State != (short)MSWinsockLib.StateConstants.sckOpen)
return;
winSockCls.GetData(ref data, data.GetType(), bytesTotal);
winSockCls.SendData("AS");
}
}
}
But "GetData()" function is not working. Plz, Help me.
Best Regards & Thanks,
Aniket Salunkhe
|
|
|
|
|
Hi all,
I am working on a chat application in which i want the application to run
on the internet i.e the application should use Http for communication purpose
Any idea about this will be a great help,
Thanks & Regards,
Pramod
|
|
|
|
|
Hello
Even over the internet you can -& should- use TCP/IP for communications.
How about making a WebService that connects all the clients together?
|
|
|
|
|
Thanks!!! for that,
Well can u tell me what technologies are used to create the
MSN messenger and Yahoo messengers?
Thanks & Regards,
Pramod
|
|
|
|
|
Hello again.
What makes you think I know that?? I honestly don't. There are many ways to make chat applications, just like I told you I only chose Tcp. It worked fine with me.
Whatever protocol you choose, I hope it would work fine for you.
|
|
|
|
|
One approach is using Remoting, which allows you to choose between TCP and HTTP channel. Check this CP article out.
Search CP for "chat AND remoting" for more chat apps using Remoting.
Best,
Jun
|
|
|
|
|
hi ,
can ne1 guide me as to how to convert a xsd to xml .... it would be of freat help if you provide me with some sample code for this...
thanks in advance....
regards,
Compdesign
|
|
|
|
|
There's no easy way to do that programmatically. You'll probably have to use a tool like XmlSpy to do it. I could have sworn Studio 2005 did it, but I can't find it now. Maybe that was Xml -> Xsd I'm thinking about.
I have a tool in beta that can do some Xsd -> Xml conversion, but that's no help to you now.
Try code model generation tools at BoneSoft.com.
|
|
|
|
|
I am beginer C#. I 'm creating small application which manage list people.
Application can add, remove, move next, comeback element. But I don't know to do a simply linked list to manage list people.
I am doing this application in Console of C#.
I like your help.
Thank you .
|
|
|
|
|
hi
try to use ArrayList or HashTable to implement the linked list
Tamimi - Code
|
|
|
|
|
Hi Tamimi.
Thank you. I try to use Hashtable but I don't know do Hashtable do in this instance.?
If you can do simply example , you can send code to me.
Thank you.
|
|
|
|
|
hi
i think according to your first post, its Easier to use array list
to do the navigation, but still you can implement the link list with
hashtable and arraylist.
feel free to post again
Tamimi - Code
|
|
|
|
|
Hi Tamimi.
Thank you.
I was completed my example.
|
|
|
|
|
how can copy UniCode to Clipboard and then paste it as text ??
as u can see the unicode in this site
http://www.alanwood.net/unicode/basic_latin.html
i want t copy the uniCode of a for example to A=0065 and then pase it as ==> A
Palestine
|
|
|
|
|
Hello
The clipboard is just another space in the memory to exchange data between applications -or sometimes in the same application-. It doesn't matter what format that data is of.
You see, you have to make some sort of a Parse() method to get, validate, and parse the data.
It all depends on in what format you expect your data to be.
eg.
if in the clipboard the data is stored like this:
HHHH HHHH HHHH
you should follow these steps:
1- Read four bytes
2- Validate them
3- Add them to a StringBuilder -just an example-
4- Repeat the cycle Until you reach the end of data
Try checking ClipBoard class in your MSDN
|
|
|
|
|
I'm reading data from the the accelerometer on my thinkpad w/ C#. Here's my problem: It's super super sensitive - it can update (1 value) even if the laptop is sitting still on a table.
Right now I made a library to poll the accelerometer driver on my laptop every 1 ms (with a Timer). On every Timer.Tick, I publish an Event. So, the calling class can subscribe to the OnComputerSlap event (which passes and x and y cord) and do whatever it wishes. However, the event handler is getting called ever 1 ms and I want to set up some type of system where it will only push the event when - for example - the x value increases by 10 since the last reading. Some type of heuristics system. Any ideas on how to do this?
/\ |_ E X E GG
|
|
|
|
|
Can any one help me out how two application can communicate with each other one is web Application and other is Desktop Application.
Rizwan Afsar
Associate Member, Technical Team
IAP Company Ltd, Gurgaon
INDIA
www.iap-online.com
"A winner is not the one who never fails,
But one who NEVER QUITS"
|
|
|
|
|
Well here's a case of "Read the Flipping Manual", if ever I saw one!
I spent ages trying to compare a control to a TextBox, mostly without success - I went through all manner of .Equals() , .GetType , == anotherTextBox.GetType(), and all I needed to do was use was if (control is TextBox)!
Gahhh!
Still, I'm interested to know what the compiler is doing, and why if (control == TextBox) generates an error - can anyone illuminate me?
Thanks,
Martin.
|
|
|
|
|
Utini wrote: why if (control == TextBox) generates an error
What error is it generating?
Mike Poz
|
|
|
|
|
|
Utini wrote: why if (control == TextBox) generates an error - can anyone illuminate me?
Because it's suppose to be: control.GetType()==typeof(TextBox)
|
|
|
|
|
Utini wrote: Well here's a case of "Read the Flipping Manual", if ever I saw one!
Exactly, RTFM. Your code if( control == TextBox) does not and should not compile for several reasons.
1) TextBox is meaningless by itself. typeof(TextBox) means something.
2) Assuming you use the code provieded (1), it is meaningless to check for equality between a Control and a Type. What on Earth would that mean?
Josh
|
|
|
|
|
The is operator checks if the object is (or inherits from) a specific class.
(control is TextBox) does the same as Type.GetType("System.Web.UI.WebControls.TextBox").IsInstanceOfType(control) .
---
b { font-weight: normal; }
|
|
|
|
|
Nader Elshehabi wrote: if(anotherTextBox.GetType().AssemblyQualifiedName == "System.Windows.Forms.TextBox")
Thats an awful way to check whether a control is a textbox, as is the title of this thread the correct way is using the is operator, or again as above the typeof() method
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
Ouch!!
Sometimes I screw things up -BADLY-, "Lack of coffee" syndrom I suppose.
Thanks for the tip though.
|
|
|
|