Diamonddrake 397 Master Poster

This simple static class contains a static method called sOnline that accepts a username as a string param. it make a call to an old yahoo api that will determine if a Y! user is online. This only returns true if the user is not using stealth, this will return false if a user is online but "invisible"

I'm not sure what enticed me to write this class. but I guess it was a fun 4 minutes anyway. :) hope someone finds use for it.

Diamonddrake 397 Master Poster

Nah, I figured out how to identify it was plugged in, but that's about it.

Diamonddrake 397 Master Poster

if you have a gateway, then in order to use it, you need specific information about it, there is no generic code for every interface.

what do you know about your gateway? is it an api?

Diamonddrake 397 Master Poster

I just started working with socket just recently I read a book on it, there is a link to a PDF here in the forum somewhere that ddanbe posted. anyhow.

the Idea is all network connections of any kind work in a client/server relationship, even if its peer to peer, the Idea behind that is, the program that initiates the connection is always the client, and the program that is listening to for the connections is always the server. In the case of your peer to peer chat system, all of your clients should be listening for connections(servers) but be able to connect to a remote endpoint(like a client) that way you cover all your bases.

but that is just a simple program model, if you wanted to do a 3 or more person chat system, it would be best if all the other clients all connected to the one client that was the original server, a relaying messages to mass users when they are all connected in a spider web could get really confusing.

Diamonddrake 397 Master Poster

You have 3 options, use a gsm modem and pay a phone company for its service, pay for a sms gateway in which the company that you pay for that will give you api examples.

or the most practical is to send emails to the SMSEmail gateways, the only problem with this option is there is a different Email address for each phone carrier, EX att is xxxxxxxxxx@txt.att.net where the x's are the phone number.

Diamonddrake 397 Master Poster

Client / server is the basic concept, the only difference is, in Peer to Peer one of the Peers acts as the Server and the Other acts as a client, you simply write in the ability for each end to be able to be the server, the only real difference is the server must be waiting for connections and the client initiates the connection.

Diamonddrake 397 Master Poster

I decided to goahead and write that article for code project. Its still pending moderator approval but the link is :
http://www.codeproject.com/KB/cs/DDFormsFader.aspx

I wrote a user32 wrapper class that handles all the fading directly without messing with the .net wrapper at all. It works unbelievably well, and its incredibly easy to use. You might want to archive this for future use, and if you get a second check it out. I wrote more comments then code, so it should be really easy to follow and its very clean code.

still looking forward to seeing that app :)

Geekitygeek commented: very nice! Nothing worse than the dreaded flicker :p +1
Diamonddrake 397 Master Poster

could possibly be managed via usb via serial data messages like an old video game controller.

a good place to start would be looking through the device manager and see if you can find the device that manages them in the list of devices, possibly as a HID compatible input (which can be communicated with fairly easily) or other usb type device.

Diamonddrake 397 Master Poster

Little tidbit of information. the reason why setting the opacity of the form to 1 causes a flicker when changed from a transparent value is because the opacity property actually uses WS_EX_LAYERED window style message and the setlayeredwindowatrributes flag to modify the way the form is displayed. when the value goes to opaque the form is then reverted back to a standard window call by calling setwindowlong and removing the WS_EX_LAYERED style bit, thus requiring windows to reinterpret how it should paint the window. since this usually happens for an effect, a refresh is called and a flicker occurs because windows is not yet ready to paint that window.

the simple solution to prevent that from happening is to never set the opacity to 1, since .99 is the 252 that's practically a 255(opaque) bit setting.

a complicated way to work around that would be to write a class that would set the window's WS_EX_LAYERED bit and have a function that would submit the SetLayeredWindowAttributes transparency bit then manually tell the windows api to redraw the window with RedrawWindow(hwnd...) this way you could always have the window ready to be transparent, but allow a full opaque setting of 255 on the transparency bit.

Sadly, as amazing as layered windows are, you don't see a lot of good articles on it. There is something called a perpixelalpha blend that allows you to set the transparency of a form based on the alpha channel of every single pixel in …

Diamonddrake 397 Master Poster

Its a little ambiguous. do you want to know how to set file associations? or know how to catch the arguments passed to your app after its been associated?

I will assume the 2nd one, as the nature of the question looks to be of that.

you must modify your Main() function. If you are using microsoft visual studio on a Forms application this will be inside the "program.cs" file in the project solution. you must modify the Main method to accept a string array.

Public Static Void Main(string[] Args)
{

//you can use it here by using Args[0] to refference it or you can pass it to the first form like:

Application.Run(new Form1(Args));

}

of course if you send it to Form1 this way you must alter form1's constructor to accept it

string[] appArgs;
public  Form1( string[] Args)
{
     appArgs = Args;
}

happy coding!

Diamonddrake 397 Master Poster

Well you can use this on button click event:

OpenFileDialog f = new OpenFileDialog();
            f.Title = "open file as..";
            f.Filter = "Doc Files|*.doc|Java Files|*.java|C# Files|*.cs|All Files|*.*"; // and in a similar way you can load any format here.......
            DialogResult dr = f.ShowDialog();
            if (dr == DialogResult.OK)
            {
                s1 = f.FileName;
                richTextBox1.LoadFile(s1);
                open=true;
            }

By the help of this you can load any other doument format files as well...............

This will work for .cs files and other native text files, but .doc is a proprietary format. It WILL NOT WORK for microsoft word documents. (if you just name a text file file.doc it doesn't not make it a .doc file. it just appears that way, true .doc are zipped special XML files and the ritchtextbox class will not parse it.)

Diamonddrake 397 Master Poster

I actually never heard of Slashdot.org but I just checked it out, and it looks pretty cool, I look forward to seeing your app.

when it comes to UI stuff with GDI the possibilities are endless, its hard to just say hey you could do something like this!!! But if you want to get into some more powerful stuff try looking into the api call ExLayeredWindow or just layered windows in general, it allows for some better looking forms but requires a lot of work.

Diamonddrake 397 Master Poster

glad to hear it! might want to mark this thread as solved.

good luck with your application.

Diamonddrake 397 Master Poster

Everything useful springs from necessity. The first hunter was hungry! I would suggest you fill the void of things you need. when in the course of your daily life something seems difficult, find a way to make is simpler.

having trouble remembering bills, write a bill reminder application. Having trouble managing your IE favorites list, write an application that manages your favorites. (these are just examples)

I am currently writing 2 productivity apps that makes things easier to me because they are tailored to my personal style of computing.

ddanbe has a great suggestion, I have my own helpful library that I expand every time I write a generically useful class.

Diamonddrake 397 Master Poster

Yes that in menu merge system, its all the rage in forms applications. If you ever used a mac you will notice that all applications you ever open do this, and the file menu is always visible on the desk top.

the menu's for each bar will always merge with the parent container, there is a property that you can change that will influence this, but not stop if from happening. As far as I know you can't easily prevent it.

This question may go furthermore unanswered.

Diamonddrake 397 Master Poster

I'm glad I could be of help, I spend most of my time in C# trying to make things look the way I want them, so I can help with a lot of drawing related issues.

Best of luck with your app, I would love to see it when you are done!

Diamonddrake 397 Master Poster

I don't think you caught most of my post. the Stream reader class will let you load text that loadfile won't.

.DOC is a proprietary format!
this means to edit it you need access to the original software that it belongs to. microsoft allows you to interlop methods from its office suite in other applications.

I.E. If you have Microsoft office installed on the computer you run your c# application on, then you can open .doc files, Otherwise you cannot!

assuming you do have Microsoft office installed on your developer machine must first add a reference to Microsoft Word Object Library then just use the code

Word.ApplicationClass wordApp=new ApplicationClass();
//Word.ApplicationClass is to access the word application

object file=path;

object nullobj=System.Reflection.Missing.Value;  

Word.Document doc = wordApp.Documents.Open(

ref file, ref nullobj, ref nullobj,

                                      ref nullobj, ref nullobj, ref nullobj,

                                      ref nullobj, ref nullobj, ref nullobj,

                                      ref nullobj, ref nullobj, ref nullobj);

doc.ActiveWindow.Selection.WholeStory();

doc.ActiveWindow.Selection.Copy();

IDataObject data=Clipboard.GetDataObject();

txtFileContent.Text=data.GetData(DataFormats.Text).ToString();

doc.Close();

NOTE: .doc files are a zip compressed special formatted XML file, but getting it right manually would be virtually impossible because there are possible hundreds of special formatting commands. So even though technically you could decompress and parse the document files manually, you would spend months getting it to work right. Better to just target machines with MS Word

Diamonddrake 397 Master Poster

you can read the contents of any file to a text box with the string reader class

using (System.IO.StreamReader sr = new System.IO.StreamReader("TestFile.txt"))
            {
                RichTextBox1.Text =  sr.ReadToEnd();
            }

but .doc files will not load as plain text because they are a special format created by Microsoft word. But if you have Microsoft word installed on the computer you are using your C# app on you can load up the Microsoft Word Object Library by adding it into the reference and create an object for reading .doc files.

but the streamreader will read most text formats.

Diamonddrake 397 Master Poster

sounds like your child forms don't have the MdiParent property set to the instance of the mdi form.

when you create your child forms you should set the MdiParent property on the form, and be sure that the mdi paretn form has the isMDIContainer property set to true.

Form2 thechildform = new Form2();

thechildform.MdiParent = this; //sounds like you are missing this.

thechildform.Show();
Diamonddrake 397 Master Poster

suspend and resume layout just stop the form from updating while making a lot of changes. since you are only making one change, it won't help you in your case.

you would use this.Refresh(); immediately after you change the opacity.

like...

void OpacityLowerTimer_Tick(object sender, EventArgs e)
		{
                       //not needed unless a lot of chaning occurs
			//this.SuspendLayout();
                        
			
			this.Opacity -= 0.01;
                        this.Refresh();
			


			//this.ResumeLayout();
		}

		void OpacityRaiseTimer_Tick(object sender, EventArgs e)
		{
                       //not needed unless a lot of chaning occurs
			//this.SuspendLayout();
			
			this.Opacity += 0.01;

                        this.Refresh();
			
			//this.ResumeLayout();
		}

That should do it. but it might flicker without double buffering.

another thing to note, you don't stop your timers in the timer tick, the method you attempt to stop it if you happen to be hovering over it at the right time, that's not the best idea. you should have it check in the tick events if you are at the high or low values example

double topopacity = 0.99;
double bottomopacity = 0.2;

void OpacityLowerTimer_Tick(object sender, EventArgs e)
		{
                       //not needed unless a lot of chaning occurs
			//this.SuspendLayout();
                        
			if(this.Opacity > bottomopacity)
                        {
			this.Opacity -= 0.01;
                        this.Refresh();
                        }
                     else
                       {
                         OpacityLowerTimer.Stop();
                       }

			//this.ResumeLayout();
		}

		void OpacityRaiseTimer_Tick(object sender, EventArgs e)
		{
                       //not needed unless a lot of chaning occurs
			//this.SuspendLayout();
			
                       if(this.Opacity < topopacity)
                       { 
			this.Opacity += 0.01;

                        this.Refresh();
                         }
                        else
                       {
                        OpacityRaiseTimer.Stop();
                       }
			
			//this.ResumeLayout();
		}

That will fix your know bug too.

Diamonddrake 397 Master Poster

you are asking your application to do a lot of changing, but you aren't telling i that it needs to repaint. after you change the opacity you should call either this.Invalidate(true); which will cause the form to repaint when but only as seen fit by the system. this is typically a good enough approach, but. since you are being aggressive about it, you will need to call this.Refresh(); which will cause an immediate repainting but will probably flicker if not doublebuffered.

a further note, you will want to stop your opacity at .99 not ever reaching 1. when you switch between partial opacity and opaque, where will be an unavoidable flicker. the easiest way around this is just going almost opaque, .99 opacity looks opaque, without the flicker.

good luck with you app.

Diamonddrake 397 Master Poster

That's alright :) I am studding for the compTIA A+ exams myself. I will continue to attempt this and if I get any where with it I will post my results. Otherwise, when you get a chance, I would appreciate some more assistance. but if you don't get back to it I understand. you have been a big help.

Thanks again.

Diamonddrake 397 Master Poster

Ok, I kinda get what you are talking about, but Im not sure how to do that. your client

private SendFileCompleteEventArgs SendFileWorker(string FileName)
    {
      SendFileCompleteEventArgs result = null;

      using (FileStream fs = new FileStream(FileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
      {
        using (TcpClient cli = new TcpClient())
        {
          cli.Connect(this.endPoint);
          result = new SendFileCompleteEventArgs(FileName);
          result.Started = DateTime.Now;

          using (NetworkStream ns = cli.GetStream())
          {
            StreamHelper.CopyStreamToStream(fs, ns, null);
            ns.Flush();
            ns.Close();
          }
          result.Completed = DateTime.Now;
          return result;
        }
      }
    }

Problem: I just can't see how to add your serialized data to that.

Problem: or even how to parse that on the otherside.

Im trying, this just really isn't my area. Also, I wouldn't mind using additional ports. as my desktop is the server for this, and working with firewalls and routers is simple.

This isn't going to be a mass used application, I intend to use it for 2 purposes. 1) to share files with a couple of my friends, and 2) to have a reliable way to send/get data to and from my desktop when I am not home.

again thanks for the help.

Diamonddrake 397 Master Poster

first off I modified your custom arguments to take a string

public class OnFileReceivedArgs : EventArgs
  {
    private byte[] _buffer;
    public byte[] Buffer { get { return _buffer; } }

    private string _FilePath;
    public string FilePath { get { return _FilePath; } }

    private OnFileReceivedArgs()
      : base()
    {
    }
    public OnFileReceivedArgs(byte[] buffer)
      : this()
    {
      this._buffer = buffer;
    }

    public OnFileReceivedArgs(string filePath)
        : this()
    {
        this._FilePath = filePath;
    }
  }

then I modified your connection callback method to return a string instead of a byte array.

private void ConnectionCallback(IAsyncResult ar)
    {
      TcpListener listener = (TcpListener)ar.AsyncState;
      try
      {
        Socket s = listener.EndAcceptSocket(ar);
        new Func<Socket, string>(HandleSocketComms).BeginInvoke(
          s,
          new AsyncCallback(HandleSocketCommsCallback),
          s);

       
      }
      catch
      {
        //You should handle this but this should be a _rare_ error
        throw;
      }
      finally
      {
        //Prime up the listener to accept another inbound request
        listener.BeginAcceptSocket(new AsyncCallback(ConnectionCallback), listener);
      }
    }

then I modified your handlesocketcomms method to save to a file stream

private string HandleSocketComms(Socket s)
    {
      //Dont do any exception handling here
      TrackThread();
      string tempfileloc = Path.GetTempFileName();
      using (FileStream ms = new FileStream(tempfileloc, FileMode.Create, FileAccess.Write)) //This may be a bad idea for big files :)
      {
        do
        {
          int szToRead = s.Available;
          byte[] buffer = new byte[szToRead];
          
          int szRead = s.Receive(buffer, szToRead, SocketFlags.None);
          if (szRead > 0)
          {
            ms.Write(buffer, 0, szRead);
            Console.WriteLine("Read " + szRead.ToString());
          }
        }
        while (SocketConnected(s));

        return tempfileloc;
      }
      //return result;
    }

Finally I modified your handlesocketcommscallback method to get the new eventarg and create the new eventargument class

private void HandleSocketCommsCallback(IAsyncResult …
Diamonddrake 397 Master Poster

That's cool. I didn't realize there was a service out there like that. obviously it works very similar to my solution. Thanks again sknake.

Diamonddrake 397 Master Poster

assuming prj means project as prj is the file extention of a Visual Basic project file. the name "web file" is a typical distinction meaning a group of browse-able files on a network, "window application" generally refers to a desktop application. Using the terms "import" and "add files" could mean coping to the project directory and referencing them...

so I gather, possibly you want to know how to download source code from the internet? possibly needing information on using subversion clients?

just a shot in the dark really...

Diamonddrake 397 Master Poster

I have been working with desktop server/client applications today, making pretty good progress when I came across a problem. the webserver I use for my website is shared and doesn't allow me access to start programs so I must use my desktop as a server. The problem with this is I don't have a static IP address. I have come up with a solution to this. But I would like to know if anyone else has any other solutions for this problem.

my solution is I created a simple asp script that gets the IP address of the computer that calls it and saves it as an XML doc to the webserver. My desktop server application periodically calls this asp script so that the XML document on the webserver stays current. Then on my client application. it checkd my webserver for the xml document, downloads it and parses it to an IP address. so that my client application always knows the IP address of my desktop server to connect to.

it works well, for now.

any suggestions on the topic I would appreciate. Code is available for anyone interested.

Diamonddrake 397 Master Poster

Visual studio's intelisense gave me all the information I needed to know to change the return type of the HandleSocketComms method and change the the memory stream to a file stream, it all works well except using this method, I can't seem to figure out how to send the file extension from the client to the server.

I think I can extend these classes you have provided to do great things for my applications. I can't say it enough. I appreciate the help.

Diamonddrake 397 Master Poster

Sorry, Im back. I understand that the memory stream is being returned, I just don't see where its getting sent to, I understand from the event handler code on the form that the memory stream somehow gets sent as an event object, I just don't see how. I am sure I will eventually figure it out. maybe after a break. i have been either reading about sockets, or mashing up socket code for a good 7 hours now and i think after a good break it will make more sense. I appreciate it sknake. you are a great asset to this site!, (you too danny, thanks again for the pdf);

Diamonddrake 397 Master Poster

your client said my 409mb video file was sent successfully in 50 seconds. but the server side windows first ran out of virtual memory and increased its default paging size. not sure why because that system has 2 gigs of ram) anyhow. then when your app auto open windows media player to play the video file, (I modified the file extention form bmp to the .avi ext) windows media player gave an error message box with soemthing in hex) and exited. I tried to modify your server to use a filestream instead of a memory stream but I was unsuccessful. as exactly what that memory stream was doing is unclear to me.

Diamonddrake 397 Master Poster

I loaded up your example solution, ran the apps and it works, I can say that :). looked through the code, and it looks beautiful. Much better than my chicken scratch. I understand most of it. I really like the custom event argument approach. Its a lot of code to take in. I am not up on threading, I understand how to create threads, and I understand calling methods on the main thread from another thread needs to be invoked... other than that. yeah... so the terms like callback throw me off, and the methods formed like this one:

private void ConnectionCallback(IAsyncResult ar)
    {
      TcpListener listener = (TcpListener)ar.AsyncState;
      try
      {
        Socket s = listener.EndAcceptSocket(ar);
        new Func<Socket, byte[]>(HandleSocketComms).BeginInvoke(
          s,
          new AsyncCallback(HandleSocketCommsCallback),
          s);
      }
      catch
      {
        //You should handle this but this should be a _rare_ error
        throw;
      }
      finally
      {
        //Prime up the listener to accept another inbound request
        listener.BeginAcceptSocket(new AsyncCallback(ConnectionCallback), listener);
      }
    }

that "new func<socket, byte[]>" line I have never seen before.

the client code seems straight forward, but if you get some free time and feel like it. I sure would like a little more explination on the server code. But only if you have time. Thanks alot.

I tested my 2 little loops on a 409mb file, and it works great on a local network. Im about to test yours with the same file and see how well it works. Thanks again, you are awesome!

Diamonddrake 397 Master Poster

wow, thanks sknake, i decided on 1024 bytes for my file packet read and writes. I seem to get ok results with it. I am going to spend a few reviewing your code and see what I can make sense of it. It appears you are using remoting, but its hard to tell, since I am new to network programming.

I just figured out a simple way to loop through the bytes of a file on disk and send it out with loop, and to read it with a similar loop. the trick was to send the length of the file in bytes to the server first. what I ended up doing was sending "#FILE:numerofbytes" to the server, when a message was received from the client it checks if it starts with a "#", if so it passes the message into my command processing method, where it checks if it starts with "#FILE" if so it splits it at the ":" and parses the numbers at the end into a long int and then I use that information to start a loop that first sends a message saying its ok to send the file, ("#RFFS") then starts the read, the client then gets the message and starts the loop of sending the file in 1024 byte chunks. the client loops and sends, the server loops and revives, part of the loop writes the bytes as they are received to a file stream its really choppy but it works, and …

Diamonddrake 397 Master Poster

first, Danny I read that entire book today, its full of good stuff. but it didn't exactly answer my question, because when it got to the complicated stuff such as sending files it moved over into concept, just telling you that you need to close the stream to tell the server the file send is over, and have the file sent in a separate thread and not actually going into any details. where are most of the book explains conventions of sending messages and getting connection information. regardless I still know much more about socket programming then I did previously, for this I thank you.

and as to you scott. I have my home network set up for 2 of my systems to have static IPs and my router forwards the port I am using to one of my static machines that I am using for my server. (I also use that machine for torrents, just on a different port) the code I am currently using all the clients connect to that machine. (I have a much worse issue now that my DSL IP address changes about 3 times a day so I am constantly updating it in my client code while testing)

but that is trivial to the current problem at hand.
I can't seem to send data in parts and reassembly it.
I can only achieve sending a small piece of data in entirety.

ex:

//netStream is a network stream object from …
Diamonddrake 397 Master Poster

not sure about using ftp. I don't know about creating a ftp server, I was curious about how to send messages and files simultaneously I assumed I would have to write a second thread that listened on another port. but I am using TCP and communicating via network streams. Both my clients and servers are desktop applications.

Diamonddrake 397 Master Poster

yes I am SURE they bought the algorithm from another company there was a 2 segment special on the discovery channel all about the history of the internet and there was a 15 minute featurette on google. I have it tivo-ed somewhere I can clip it and post it if you need proof. :)

Diamonddrake 397 Master Poster

Thanks danny! That's a great link. nothing like a free book on the subject!. I read through a bit. i will delve into it as soon as I get a chance.

Diamonddrake 397 Master Poster

I recently started messing with tcp socket programming. I hacked up a little instant messaging application that seems to work has some little problems but the world isn't in need of more IM clients. but I wanted to know a good practice for sending large files over tcp sockets.

i made a simple client server app pair that will let the client send messages to the server. I have the server check the messages for special strings to tell it how to respond, if "#FILE" is sent it knows to write the next stream byte array to disk as a file. and this works great for a 25kb image. but as for a large file. how is this done?

also, how would progress data be sent?

i currently only know how to send the fully byte array in a single chuck, and I can't seem to find any GOOD, documented code examples.

if anyone knows and good links or code examples I would appreciate it. I would like to create a a simple app that runs on the system tray that would let me and my friends easily transfer files of any size back and fourth. there are a BILLION google result titles "C# sending files with TCP." but I looked at hundreds, the were either poorly written with no understandable comments, or they were other people asking my question with no answers.

Diamonddrake 397 Master Poster

I think sknake posted a good snippet on a different question here on this forum, when I get a chance I will find it for you. also. it depends what you are searching through. will it be a list of objects?

Diamonddrake 397 Master Poster

That is a good use for it! thanks for sharing!

Diamonddrake 397 Master Poster

that's really neat danny. Idk when i might ever need it. But I'll add it to my private code snippet library just in case. right next to that numbers only with 1 decimal point only textbox class.

Diamonddrake 397 Master Poster

well I can tell you Google didn't write it. they based their entire empire on something they paid for with petty pocket change.

Its a great system, they have evolved the original algorithm a bit. It is unclear to me why you would post this question in the C# forum. if you were wanting to create your own web search system there is an asp.net daniweb forum. if you are interested in setting up a windows forms search system there is a keyword scoring system that can be used to do a pretty good search.

Diamonddrake 397 Master Poster

I am still not sure, your screenshot shows widows explorer while editing the name of a folder, if you wish to pass the name of a rightclicked folder to a program you don't need it when editing text.

you can modify the registry's HKEY_CLASSES_ROOT. it has a key named FOLDER you can add a command to that easily that will make rightclicking on a folder give you the ability to open your program passing to it that folder.

here is a codeproject example:

http://www.codeproject.com/KB/cs/appendmenu.aspx

otherwise it is unclear of your goals. I hope this helps.

Diamonddrake 397 Master Poster
Diamonddrake 397 Master Poster

well I am sorry to say, this isn't exactly beginner type programming. Its a goal to work toward, break it into small pieces, get each part of the concepts working, then bring them together.

but I am sorry, I can't really help you much with it, as I'm not a great network programmer. Best of luck to you and your application.

Diamonddrake 397 Master Poster

Im not sure why you are using 2 executable for this. why not write a control that does its own scrolling text? not very difficult.

but you can easily create an event that when the background image of the panel changes just save it do disk and read it with the other application.

panel1.BackgroundImage.Save("C:\\myimage.bmp");

but why do you need 2 apps for this?

Diamonddrake 397 Master Poster

This is not my area of expertise, but I think I can give you some ideas if anything.

A good start would be developing a client/server type application, the server would run on the computer you want controlled, or accessed from the outside, the client would be a standalone app you could use on any internet connected computer to access your server computer.

the server app should wait for a connection attempt and once successfully connected broadcast general information about the system to the client as requested. cursor position, active windows, directory information. there are windows apis you can import that will let you tell the system to click the mouse, release the mouse, ect.

of course the true MS remote desktop logs you in as the user, and lots the local user out, that type of concept I wouldn't know where to begin, but as for controlling the mouse and seeing the screen via a networked computer, it wouldn't bee to amazingly difficult.

Diamonddrake 397 Master Poster

You have some foggy spots, lets clarify.

is it 2 separate applications, or 2 different forms in the same application?

If it is 2 separate apps, are they both written by you and are editable?

Diamonddrake 397 Master Poster

if you are creating a snake game you might want to create the snake as instances of a custom drawn square, so that you can place instances on the game board as positions on a grid. as this is how the game snake was originally written. ( I did one in javascript way back when )
just drawing a line will get really complicated when it gets to having your snake follow a movement path with corners.

best of luck.

Diamonddrake 397 Master Poster

ITS A GREAT LANGUAGE FOR INDEPENDENT GAMES!!!
nah really it is. infact you can easily develop managed direct X games or use the XNA framework which is a C# exclusive development framework that allows you to easily make 2d and 3d games for windows, XBox360 and the Microsoft Zune. and its free!

and the thing about size, can apply, or cannot. typically C# apps are smaller than C++ apps because many of the necessary code is included in the prerequisite the dotnet framework. but if you are writing directX games, you tag on about 5 megs in managed libraries, but that's not really a big deal in this the age of broadband, cheap CD-Rs, DVDs and the 50gig dual layer blueray data disk :)

best of luck.

Diamonddrake 397 Master Poster

you simply download the source and open the project file, the standard for C# is a Visual Studio solution. but whatever editor the source code project is written in is the best to use. Not likely its written with eclipse, but it might be.