C# Client2Client - c#

I'm trying to create a simple Client2Client console chat, for learning purposes, using C# and, blame my lack of experience in networking, I'm stuck.
From what I've been able to deduce, and correct me if I'm wrong, I should create a Server .exe and a Client .exe.
The thing is, I know how to use HttpListener to get requests from a client and then send a response to him, but I can't seem to find a clear answer on how to get data from a client and then send it to another client.
I tried Google but my doubts are as strong as before. Any suggestion would be extremely helpful :)

Related

C# offline OTP for service authentication

I'm searching for a way of authentication like that from Blizzard (Authenticator). It creates an off-line OTP.
I know that larger companies use it as "tokens" however, I'm still unable to find a proper library.
So, what I want;
A project that is able to create OTPs on the client side without having the client to connect to the internet and yet be able to generate the exact same on the servers-side.
I think you can take a look at this library: https://code.google.com/p/otpnet/
It is a C# port of a popular TOTP/HOTP for PHP. There seems to be a few outstanding issues in the library which have not yet been fixed by the developers but you can easily patch it on your side with recommendations that have already been submitted.

Creating webplugins

I am trying to create a program that will be passed input data from events a user fires from a webpage on their browser. I am aiming at google-chrome currently with the program being in either java or C#. I know this is possible because Spotify does this, so does the Battlefield 3 PC gui. How can I go about doing this? Does the user need to install an extension or can I get that information straight from google-chrome? Note: The webpage is not being run on localhost.
You're going to want to look into web sockets. Web sockets are just cool. I got a huge grin on my face the first time I got demo working. :D
Here's a tutorial that helped me out:
http://www.developerfusion.com/article/143158/an-introduction-to-websockets/
You can create a socket listen in your appilcation then connect to it from javascript, passing whatever data you desire. It's nicer then ajax as it's a persistent open connection and you don't have the overhead of http calls.

How to connect a Chat Client to a game server?

I just want to create a "Chat Client" that can connect to a Game Server..
My problem is that I dont know how to start, I've already read several tutorials about socket programming / chat client / server client / etc. but I can't find a way to implement it on a game server.
The server I want to connect is a Battle.net server "Warcraft III".
I've already know the IP Adress of the server but I dont know how will I able to access the game server.
The IP address of the server serves as a Webserver "acts a forum" and a GameServer "of course the game itself".
to summarize my problem:
I just want to create my own "Topaz Chat" using C# but I dont have any idea how to do it?
any idea? guys even a keyword is enough, I will try my best to find a tutorial for it. I know its hard to answer my question because I failed to provide any code T_T
First things first, you need to find out the protocol that the chat uses. Try to find answers to these questions:
Do you really need raw sockets?
Is the protocol a know protocol, such as IRC?
What are the chat's commands and how are they processed?
When you find these answers, you'll be half way there.
If you are saying that you can access the Battle.net to get some informations, then I believe it uses a WEB SERVICE. Using it, you can request some informations or to create a room or something. You should not use socket programming. WCF is a highter level technology of .NET. Use it as web service.

C# Know if server is being accessed from application

I have recently created an API on my server in PHP, but I have discovered that I shouldn't use my API directly with an API key because sensitive information like that can't be held securly inside an EXE. I did some research and people recommend creating a proxy between the API and your application, but even still that can be broken into.
I was wondering, how can I make my server know if it is being accessed from my C# application, or from another source? The reason why I want to know is to stop potential hackers accessing my gateway and using it themselves.
Thanks
SSL with a login?
There is no way for you to be certain someone is using your application to access a web service. I'm in a similar boat, and the most you can do is ensure the communication channel is secure (SSL) and use a username/password or something similar. You also have to be aware that anything done on the client's computer can be compromised. So much so, that you should pretty much assume that your application will be open source to anyone that wants it.

How to create an IM bot with C#

Is there an easy way to create an IM bot on multiple im networks (aim, gtalk, yim, etc) that can accept and interpet specific commands sent to it to perform a server related task?
Lets say for instance I have a website for managing an rss feed. I want to send a command to an IM bot to add another feed to my collection. the IM bot would associate my screen name with my account from prior setup on the website.
I have done some internal bots for my company using the XMPP (Jabber) protocol, I've used the agsXMPP SDK and the Jabber.NET client libraries, I was looking for APIS to work with YIM, AIM and Windows Live Messenger but I've found only COM exposed APIS, nothing for .NET...
But an idea comes to my mind, with the XMPP Protocol you can configure a local server with IM Gateways, that allow users to access networks using other protocols through your server
I use eJabberd, you can install a variety of transport gateways to connect with other IM protocols (AIM, MSN, ICQ, GTalk...
To GTalk you can connect directly using the libraries I mention...
A sample ICQ gateway:
The short answer to this question is yes this can be done relitivly easily. Sedning and receiving IMs sending, receiving and interpreting requests from the network you wish to communicate on and there are libraries available for each of the major IM protocols to make this easier.
For messenger you can try the DotMsn library, I have used it in the past but at that time it was still quite new and I have not used it since so I can't vouch for it's quality.
Jabber uses the XMMP protocol which is an open-standard so there are bound to be plenty of client libraries available.
If I recall correctly Google Talk uses this protocol or a modified version thereof.
I dont have experience with c# but I have written one for AIM and Gtalk using PHP. http://www.imified.com/ is the best place to start if you looking for a easier way to write an IM bot.
Basically you create an account in imified.com .
Name your bot and link a script.
When ever a message is sent to the bot, imified.com automatically runs this script.
Here is a link for you get you started!
We have professional .NET/COM/VCL library for MSN/Yahoo/ICQ/AIM/GTalk/Jabber. Please take a look at http://www.imcomponents.com/ if you like.

Categories