|
Welcome to CodeProject
jwangAimCo wrote: I am new at writing both C# code and with network protocol.
jwangAimCo wrote: I need help implementing that code in C#.
This is what I have tried:
First there is no updClient class so your code does not compile, it's generally not acceptable to post code that does not compile unless your question is about the compiler error.
When you say "this is what I have tried", why did you try that? I mean are you just randomly typing things in or do you have some material (book, article, whatever) that you are using that maybe targets beginners? If not, I strongly suggest you find and use some material that is targeting beginners since you are one.
One other observation, I generally advise against a beginner jumping right into something like IPC. IPC is an advanced topic and therefore not well suited to beginners.
led mike
|
|
|
|
|
Thank you "led mike" for that judicious response. You have been as helpful as you have been welcoming.
I guess I was mistaken when I thought that this forum was for learning things and helping each other. I am sorry for being new to this, but prefacing my post with, "I am new at both writing C# code and network protocol" obviously wasn't explainitory enough.
Unfortunately for you I don't just give up on learning things I don't know. I am still hoping that somebody could lend me a hand. I apologize for not being an elite coder, but then again if I knew how to do this I wouldn't be posting.
In my pseudo code I wasn't looking for the code to be written for me, I was merely posting some of the things that I was currently playing around with, however here is the code that I am working on right now. It won't compile (disclaimer), because it is buried in a larger namespace, but I have included the localized button code and the System files that I was using. Should be a simple copy paste.
using System.Net.Sockets;
using System.Net;
private void button_SearchAgain_Click(object sender, EventArgs e)
{
byte[] data = new byte[1024];
string input, stringData;
IPEndPoint ipep = new IPEndPoint(IPAddress.Broadcast, 20034);
UdpClient udp = new UdpClient();
Socket server = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
string burnR = "NRUBR";
data = Encoding.ASCII.GetBytes(burnR.ToCharArray());
udp.Connect(ipep);
udp.Send(data, data.Length);
IPEndPoint client = new IPEndPoint(IPAddress.Any, 20034);
EndPoint Remote = (EndPoint)client;
byte[] rcvdata = new byte[1024];
if (udp.Available>0)
{
MessageBox.Show("You are here.");
}
server.Close();
|
|
|
|
|
jwangAimCo wrote: Unfortunately for you I don't just give up on learning things I don't know. I am still hoping that somebody could lend me a hand. I apologize for not being an elite coder, but then again if I knew how to do this I wouldn't be posting.
Ok, good luck.
led mike
|
|
|
|
|
If you have working C++ code, you can build it into a C++/CLI dll and call it from there.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
 I figured it out after messing with some Ethernet sniffers and other utilities. I'm posting the code for anyone else who may find this useful in the future.
private void FindBoards()
{
ArrayList crArray = new ArrayList();
byte[] sendData = new byte[1024];
byte[] rcvData = new byte[1024];
Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
s.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, 1);
IPEndPoint localEP = new IPEndPoint(IPAddress.Any, 20034);
IPEndPoint broadcastEP = new IPEndPoint(IPAddress.Broadcast, 20034);
try
{
sendData = "whatever you want to send";
s.Bind(localEP);
s.SendTo(sendData, broadcastEP);
s.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, 2000);
}
catch (System.Net.Sockets.SocketException se)
{
MessageBox.Show(se.Message);
}
try
{
int rcvSize;
int crIndex = 0;
DateTime rcvTimer = DateTime.Now.AddSeconds(1);
do
{
rcvSize = s.Available;
if (rcvSize > 0)
{
EndPoint local = (EndPoint)localEP;
int iRX = s.ReceiveFrom(rcvData, 0, 1024, SocketFlags.None, ref local);
}
} while ((rcvSize > 0) || (DateTime.Now < rcvTimer));
}
catch (System.Net.Sockets.SocketException se)
{
MessageBox.Show(se.Message);
}
s.Close();
}
|
|
|
|
|
Have a friend i want to take down in Scramble. Downloaded the source files and the demo, then downloaded from Microsoft the .NET Framework V2.0 50727 to run the stuff. Still won't open. What do I do now (i am an absolute amateur at this...)? Please someone save me from complete humiliation
|
|
|
|
|
It would be nice if you described what "Scramble" is and where you got it from.
And what do you mean by "won't open"?? Any error messages??
|
|
|
|
|
Scramble is an online word game on Facebook being played by many many people at the moment. The Code Project has produced a Scramble dictionary which allows the user to put in the scrambled letters (in a random 4x4 grid) into a form which provides all the possible word combinations that follow the gams rules.
The source code and demo was posted to this site on 27 November and the download required me to have .NET program. I downloaded that, but still no luck. I will post more info later today. Thanks for the reply
|
|
|
|
|
David Kinsella wrote: The Code Project has produced a Scramble dictionary
Wrong. A single person has posted an article on the CodeProject. There is a forum at the bottom of every article. Questions concerning that article should be posted in that forum.
David Kinsella wrote: The source code and demo was posted to this site on 27 November and the download required me to have .NET program. I downloaded that, but still no luck. I will post more info later today.
No luck with what?? Compiling the demo source?? Running the demo project?? What error messages do you get?? What actually happens?? Without this basic information, there's little anyone can do for you.
|
|
|
|
|
Hi,
In WPF Client application project I have one requirement where in I am required to fetch certain email attributes (Subject, From, Date etc.) from an .msg file.
How can we achieve this?
Thanks in advance.
Thanks & Regards,
Deepak.
|
|
|
|
|
|
Vietnam travel information | Vietnam tour companies | Vietnam luxury adventures | Vietnam adventures travel | Vietnam guided tours | Vietnam luxury holidays | Vietnam luxury tours | Vietnam luxury hotels | Vietnam travel agents operator | Vietnam adventures tours | Trekking tours | Biking tours | Kayking tours | Cycling tours | Walking tours | War veterans tours | Cruising tours | Birdwatching tours | Day trips tours | Honeymoon trips tours | Photo tours | Teambuilding tours | Art tours | Family tours | Cookery tours | Golfing tours | Diving tours | Excursions tours | M.I.C.E tours |Visa to vietnam | Visa to laos | Visa to cambodia | Hotels in vietnam | Hotels in laos | Hotels in cambodia | Resort in vietnam | Resort in cambodia | Restaurents in vietnam| Restaurenst in cambodia.
Vietnampathfinder Travel
Vietnam Tours
Vietnam Art tours
Hanoi Art tours
Vietnam family vacations
Vietnam Family holidays
Vietnam tours for family
Vietnam Tour Operator, Travel Agent , Vietnam 's Leading Hotels and Resorts Online Reservations www.vietnampathfinder.com offers discounted flights, hotels and resorts, car rental, visa Arrangement, first class holidays, tailor-made tour packages, eco-adventure travel to the mystical, exciting and Newly Discovered destinations in Vietnam, Laos and Cambodia.
http://www.vietnampathfinder.com
|
|
|
|
|
Hi,
It is a window application.i have a assembly of it. it have a win-form which have some control. like button or text boxes.
I want to create dynmic event of win- form control so how i can do.
|
|
|
|
|
|
Member 2982177 wrote: I want to create dynmic event of win- form control so how i can do.
do not see the purpose.
Tan Li
I Love KongFu~
|
|
|
|
|
Can any body help in the implementation of balloon callout using ASP.Net Ajax Toolkit. As i am very new in implementing of Ajax to Asp.net !
I need a Balloon Callout to be implemented one Mouse Over
thanks in advance !
help me please
|
|
|
|
|
You should ask questions related to asp.net in ASP.Net forum
|
|
|
|
|
Hi,
I have a doubt regarding order of exectuion of mark and compact algorithms in Garbage collection process,
which one will invoke first mark or compact, does compact algorithm execute firstly whenever all the roots were collected?
Thanks
Mukkanti
|
|
|
|
|
Hi,
a standard GC algorithm is first looking for live objects ("mark"), then either:
- delete the unmarked objects;
- or compact the marked ones, ignoring the unmarked objects.
In .NET compaction is used (except for the "Huge Object Heap").
|
|
|
|
|
I'm trying to catch the mouse down and up event and add them to a button control.
I'm planing to use IMessageFilter to add the missing events.
Now to my problem, It seems like application.addfilter don't exist's in cf...
Do anyone have a clue on how to catch mouse events in cf??
Or perhaps i'm looking in the wrong direction? Is there a better way to do this??
Thanks
Ola
|
|
|
|
|
I'm looking for a utility that can tell me whether a .NET assembly project has been compiled using x86, x64 or "AnyCPU" (which determines the platform to use at runtime).
If dumpbin.exe displays this information, I'm not seeing it...
As for filever.exe (KB913111[^]), it's generating puzzling results--I'm seeing "W32i", which apparently means the EXE in question is x86 (I know I've compiled that EXE using "AnyCPU"). To make matters worse, according to the KB article, the 32-bit version of filever supposedly can return different output than the 64-bit version. So much for keeping things straightforward...
I know I can tell with Task Manager when the app is running ("xxx.exe" vs "xxx.exe *32"), and Process Explorer can also show it in one of its Properties window, but in this particular case, the app only runs for a few milliseconds, so I don't even have time to see it listed...
|
|
|
|
|
|
Yes...a slight rewording of my Google search keywords revealed this...
Thanks Giorgi.
|
|
|
|
|
Nice to see that you found it
|
|
|
|
|
Hi, I'm working on a trusted intranet written in ASP.NET, and I need to make a thin client interact with the client computer (mostly to browse, upload and delete local files)
My first attempt was to found two ActiveX providing these functionnalities (one to browse and delete files, other to upload local files) but none of these are covering all our needs.
Then I had a look to the very promising Silverlight 2.0 but it works in a sand-box and the security cannot by downgraded (although I ay use JavaScript to delete files, after being choosed with a Silverlight user interface ?)
So my question is : is it posible to write graphical .NET ActiveX controls to achieve our needs ? I've done C++ during several years but I'm now closest to .NET
Thank you for your answsers.
|
|
|
|