Diamonddrake 397 Master Poster

I like it.
You say its not really a control, rather that its faked. but don't you realize that if the treeview was on its own borderless form and was created and called via the button next to a textbox, and you encapsulated all the code in a usercontrol it would be a true simple drop in control VS what you are calling a fake. Its a really good idea. And you have taken it all the way to the end. all that is missing is a little tidying up to make it a full fledged drop in control.

Good work.

you could even use EX_Animate_window to make it slide down and up when appearing, if you wanted too.

If you are interested in this and need some help getting started i would love to give you a hand.

Diamonddrake 397 Master Poster

IF you want to affect the first form, why would you create a new instance of it? What you need to do is pass THE instance of the first from to the second form. then act upon that instance, easy.

//this is form1's button click to open preference from 2

private void prefferencesbtn_click(object sender, EventArgs e)
{
      Form2 prefs = new Form2(this); //the secret!
      prefs.Show();
}

//now the form2 needs to catch this instance and hold it.

Form MainForm;//create class var to hold form1 instance.
//constructor for form2
Public void Form2(Form mForm)
{
     //catch the instance
    MainForm = mForm;
}

//now your code

        private void button1_Click(object sender, EventArgs e)
        {
            if (comboBox1.Text == "800x600")
            {
                MainForm.ClientSize = new System.Drawing.Size(800, 600);
            }
            if (comboBox1.Text == "300x300")
            {
               MainForm.ClientSize = new System.Drawing.Size(300, 300);
            }
        }

Happy Coding!

Diamonddrake 397 Master Poster

Some people just aren't comfortable with editing the registry or running vb scripts. It only takes about 5 minutes to do it manually, but with this little app it takes about 10 seconds. So instead of saving a url with instructions and consulting them 10 times. You just download this exe, open it. It automatically prompts for elevated privileges and then you just click a button and a few seconds later, its done.

It only took about 30 minutes to write, I mean its not rocket science, and since all my friends and family will be consulting me on the upgrade I figured why not just throw the workaround into a one click solution.

Diamonddrake 397 Master Poster

When I installed windows 7 I opted to do a fresh clean install, but the key I purchased was an upgrade key and required that I performed an upgrade. The disk itself was bootable so I performed a clean install and modified some registry keys and ran a vb script in the system32 folder and this enabled me to enter my upgrade key to activate window even though the system knew I performed a clean install.

This isn't illegal, Its just a workaround. Since I had a legal copy of windows to upgrade from, I didn't break the EULA. I decided to automate this by writing a little application that applies the patch automatically. I am 90% sure it works, but I can't test it. So if anyone out there is about to install windows 7 with a clean install from an upgrade key. Please try out my patch and tell me if it works!

Thanks.

Diamonddrake 397 Master Poster

Glad to hear you got it!

Diamonddrake 397 Master Poster

a separate picture box for each image yes, your bottleneck in performance will be loading the images from disk, Creating a new image using the images is just an extra step that is even slower, a few picturebox controls won't suffer you any performance. Its the images that they hold in memory that makes a difference. But 10 little picures and one big picture made of the little pictures will take up the same amount of memory. But your system will actually handle many little pictures better than a very big one.

But before you go trying to reinvent the wheel try the imagelistview control from code project.

Its probably the most amazing free control i have ever seen, and its very customizable. check it out! http://www.codeproject.com/KB/list/imagelistview.aspx The guy said it can easily handle thousands of images, and just playing around with it, I open my entire MY Pictures folder containing over 1000 images and it handled it just fine, smooth scrolled and looks great.

Diamonddrake 397 Master Poster

The way you are doing it isn't bad, you just aren't using the buffer idea correctly, the paint event should just draw the buffer image, nothing else. all the other stuff including the loop should be done in a loadthumbs method, what you have accomplished is to reload the images and draw them to disk EVERY time the picbox invalidates.

but a better way to do it would be to use multiple picture boxes on a user control, the picturebox has a Asynchronous image loading method build into it. So it would be very simple!

create a usercontrol that has a collection of image locations as a property, when the property is changed, have the usercontrol loop through and create a picturebox for each element in the collection and load the images using the Asynchronous load method of the picturebox. And presto, easy, fast, effective, and elegant control, that is reusable, and fits your needs.

Diamonddrake 397 Master Poster

This is the C# forum, this is an asp.net question. I advise you post your question there for best answers. But its a simple solution. just use session variables. Create a long in form that compares to a hard coded username and password, if successful, create a session variable for that user called isLoggedIN for something like that, an on all the secure pages redirect if the variable is false.

Just google it, its all over the net.

Diamonddrake 397 Master Poster

I'm interested. Details were emailed to address above.

Diamonddrake 397 Master Poster

I don't recommend using wmp.dll, but I do recommend using directshow. Windows is built around directX. included in directX 10 and higher is the directX managed libraries that supply you with video and sound objects that are very simple to use.

DirectShow automatically builds a filter graph for video so you don't have to do it manually. that's how windows media player does it. the only real alternative is to manually build the filter graph, but I don't know why one would bother.

as for the skin. the simplest way is just to create custom drawn controls for each part you need. But if you are looking for some good grades you could write a skin engine and create a DLL full of resource images and have a loop that goes through them and applies the matching resource named images to matching named controls allowing they to be easily changed by changing which dll is loaded, and have it loaded by reflection so it can be easily switched out. (a folder of images or zipfolder could work equally well).

best of luck.

Diamonddrake 397 Master Poster

um... What?

Diamonddrake 397 Master Poster
List<string> mylines = new List<string>();
            using (StreamReader sr = new StreamReader("myfile.dat"))
            {
                while (sr.ReadLine() != null)
                {                
                   mylines.Add(sr.ReadLine());
                }     
            }

Yeah, That should work. assuming each line is a separate value, otherwise you will need to load it all to memory as a string and split it to an array using the delimiter. Post back if you need more help.

Diamonddrake 397 Master Poster

Essentially, the method called in that library expects some object references from the MSWord application. to use the method you have to match that methods params, since you don't have those values, you have to pass null values.

the first param needs to be a reference to a string with the value of the file path, the nullobj is just as it says, its an object that is null. the method needs an object reference, so if you just pass null it will fail, so you create a null object and pass that.

the ApplicationClass creates an object that is the one word uses to create the editing window, so now you have this object that you can grab the text from. That's how it works.

if you are wondering how we know what values to pass, that would be microsoft word documentation. since its not a managed dll it doesn't share that information. When microsoft created the com object responsible they also wrote documentation for it. The original author of the code above got it from there. but that wasn't me.

Diamonddrake 397 Master Poster

I couldn't have said it better myself sknake! I think the best practice would be, if you are scared someone will copy your video, put a watermark on it. that way if someone does copy it, its obvious, and everyone knows where it came from, that's one of the many reasons TV stations keep a logo at the corner of the screen.

Diamonddrake 397 Master Poster

as mentioned before, .doc files are ZIP compressed xml files. so if you read the data of a .doc file using the code I posted it will not show you the text it will show you the result of the binary compression expressed as ascii characters.

Sorry. the point of all my posts was to explain that word is a special format that requires an office interlop to read.

Diamonddrake 397 Master Poster

I'm not sure what's causing the error you are receiving. But it looks like you are trying to send the length of the data, the Filename, and the data itself as one object. then trying to pull out the data before you are sure that you have actually received that information.

a good idea would be to first send the length of the file and the filename and then wait for the server to send a message saying its ready to receive the file, then the send the file data. and on the receiving end use a loop that keeps loading data til the read data matches the length sent.

But I am sure sknake is just going to post you a fixed version when he has time anyway. But if you are looking to do it yourself, it helps to start simple, then build on it. That's how I did it. Started with 2 console applications a client and a server, set them up to send and string messages back and fourth the added special commands to send files, then added progress indication, and eventually turned it into a forms application.

Diamonddrake 397 Master Poster

the Microsoft office assistant can be loaded as a com object to achieve that effect. but then you have to assume that all users of the app are using a version of Microsoft office.

Diamonddrake 397 Master Poster

there is no fool proof way, but you could embed the videos into the application, when you needed to play them create a memory stream from the resource and play it from there, or copy it to temp, play it then delete it afterwards.

the only tactical way would be to create your own video codec that has custom drm, and only allow it to be played via a code your application has.

Even then, a crafty pc user could always find a way to copy it. There is a FREE utility out now that lets your copy blu-ray disk. Your asking a hard question.

kvprajapati commented: Very good suggestion. +6
Diamonddrake 397 Master Poster

on the usercontrol's cs file create an event delegate and event like so

public delegate void onMyEventHandler(object sender, EventArgs e);
        public event  onMyEventHandler OnMyEvent;

then when the usercontrol needs to tell the form its time to be removed. just call that event

OnMyEvent(this, new EventArgs(null));

on the main form you just create your event handlers as usual.

usercontrol myUserControl = new usercontrol();

myUserControl.OnMyEvent += new myUserControl.onMyEventHandler(catchevent);

void catchevent(object sender, EventArgs e)
{
     Panel2.Controls.remove(((control)sender));
     //or Panel2.Controls.Clear();
}

something simple that that should work. sorry its been a while since I have been on because I have been really busy.

Diamonddrake 397 Master Poster

if you are referring to the controls on the form, suspend and resume layout methods of the forms class tells the form not to bother painting the controls until its finished creating them, but I don't know about this scene manager you speak of, so it may not support suspendlayout or resumelayout.

Create a new windows forms application project in visual studio and then drag some buttons onto the form from the tool box, then in the solution expand the item for Form1 and open Form1.Designer.cs notice that in the initializecomponents method defined there that before any controls are added this.suspendLayout() is called. Then after each control is added this.resumeLayout() is called. This prevents the display from acting crazy until all the controls are successfully added.

Hope this helps.

Diamonddrake 397 Master Poster

Its not a good practice to ask a new question on an expired thread. but setting windows explorer file association is done 2 ways, both in the registry. there are great articles in code project about it. go have a look.

Diamonddrake 397 Master Poster

Its a far back reference, but using DirectX is a very good practice. and all windows computers XP and up have DirectX installed. It's installed with windows and comes as an automatic update as well. The managed directX libraries have very easy to use audio and video objects that is as simple as passing it a filepath, giing it a parent control to play on, and calling play.

This is just for future reference. Glad you already have this solved.

Diamonddrake 397 Master Poster

If you need to customize all 3 of the buttons events, the standard practice is to create a your own title bar control such as seen on AIM and Y! instant messengers.

otherwise, DDoubleD has the right idea.

Diamonddrake 397 Master Poster

the system must have a equivalent or newer version of .net installed. not necessarily the same version.

and yes, as the previous person stated. the UAC in vista forces applications to automatically be ran as if the user does not have admin rights even if they do. there are ways around it. but the best practice is just to play it safe.

Diamonddrake 397 Master Poster

That's really up to the programmer. If you work for a company that expects this, then its up to them, but if you are just writing software by your self it doesn't really matter.

The big selling point of putting logic in classes is portability. once you have written it once, you can easily use it in other applications. another thing is it keeps your code organized, so in a large application its easier to find and edit your code.

but writing a class for 10 lines of code that could easily be condensed into 5, that's just silly.

Diamonddrake 397 Master Poster

I have ran all of my apps on both XP and Vista, and the only issue I have had with 32/64 bit is on one of my apps I imported a few methods from user32.dll. on 64 bit vista 1 of the methods I imported didn't work. application still ran fine, just didn't perform that method. DdoubleD is right. Just compile for "any processor" its the default. and it should work fine, but its always a good idea to test the program on 64 bit before releasing it as 64 bit compatible.

Diamonddrake 397 Master Poster

you create an event handler from a button on the usercontrol in the main form then just do the removing there, Could be a lot of solutions.

Diamonddrake 397 Master Poster

Don't you love those people who obviously just joined the forum for the single purpose of asking a complicated question in a manner that makes it seem just a simple as "which way is the bathroom?"

Reminds me of when I first started programming. Once you get into the mindset. You look a problems completely different. And the questions you ask are much more refined. But sometimes its the difference between "Do you know were I could get some lumber and a hammer?" and "I would like one(1) free house please."
lol.


as for the OP. Glad024 try you some of this http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=576

Diamonddrake 397 Master Poster

Its all basic list view control stuff. the list view can be difficult to work with, I recommend a ListView control tutorial. there are many. If I were to explain to you all that your question entails inside of this reply, it wold practically be a book.

here's a good start:
http://programmerslog.wordpress.com/2008/07/18/using-listview-control/

But that's just a start, google around, there are some good articles out there.

Diamonddrake 397 Master Poster

since you always clear the controls on the panel first, seems like it will always be the only control on the panel, so panel2.controls. clear(); should work.

but you could also use panel2.Controls[0].Remove(); seems like there could be several ways to go about it.
you could even expose the panel2 as a public property of the form and modify its contents directly through the property.

Diamonddrake 397 Master Poster

If you write an application targeting the .net framework it will work across XP, vista, and windows 7 no problem. the 32/64 bit crossover might give you trouble if you use a lot of windows interlop. but other than that This is one of the things .net was made for, all .net languages work together perfectly, and all .net enabled versions of windows run the .net applications equally well.

happy coding.

Diamonddrake 397 Master Poster

Sorry, VPN is a safe way to transmit data, but I don't know much about it. and no you can't forward ports through code, but you don't have to worry about the ISP, just the router that is responsible for your LAN. if you check your internet connection on one of those PCs and get the "gateway IP" enter the gateway IP into a browser and you will be prompted for the password to the router, just go to PortForward.com. It will give you step by step instructions on forwarding ports on hundreds of routers.

Diamonddrake 397 Master Poster

as far as playing MP3s go best .net solution I have found is a free library from here http://www.ambiera.com/irrklang/ its called irrklang and works great and is simple to use, comes with examples. That's what I use in my apps.

as for capturing video you have to programmatically build a "graph" that tells the system what device, what input, and what codecs to use. Its complicated and I don't have any working examples I could share.

Diamonddrake 397 Master Poster

...Sockets are basically how the internet works, and how you connect to a computer on a "local" network from the outside world is by configuring the router that controls the flow of information on the "local" network to forward a port to a particular device. That's pretty much the only way its done. So I'm not really understanding your problem.

lets say you are in a internet cafe. all the computers there are on a network to share the internet. now the Router that routes the information between them and the internet assigns all the computers there a "local" address, 192.168.1.100, 192.168.1.101, 192.168.1.103 This allow the router to know who's who. but no matter what computer on that network sends out a request, the internet sees it coming from the address that the router revcieved from the ISP's routing system. that's the external IP. now in order for your program to be connected to by the outside, the local router has to be configured to redirect all the data passed on a particular port to a local address. if your app is on 192.168.1.101 on the local network then the port you use on that program needs to be set to be forwarded by the router to 192.168.1.101

Now if you use a webserver that is directly connected to the internet, not on a local network. you can connect to that more easily, then use a program on …

Diamonddrake 397 Master Poster

once connected, the tcpClient object holds a reference to the client connection, so you use that object to send and receive data. you never worry about the IP or routing of the client.

Did your college programming instructors not do a very good job of explaining it?

Diamonddrake 397 Master Poster

the trick is that you have to set up a forwarded port on the router to the network that will be connected to.

example, if network A has an external IP (the IP that the internet sees) of 168.100.159.172 and it supplies internal IPs (lan) incremented based on 192.168.1.100 Then that router needs to be configured to forward the port your application uses to the computer on the local network that is running the server application.

then the client is just told to connect to the external IP of the network the server is on in this example 168.100.159.172 at which ever port is forwarded for the app.

If you don't have access theses settings your only option is to use a 3rd system somewhere on the net as a server that will relay the information.

Diamonddrake 397 Master Poster

Actually. your best approach is to create a directory on the drive and encrypt that. and write a program that handles the encryption. a well written app could even have that dir appear as the drives root and allow interaction with the contents through explorer.

but seriously. if you really want to protect you data, and not just do something nifty. you are going to have to use hardware encryption. the device itsself will have to handle the encryption.

the way you are going about it will just protect your system if the autorun is enabled on a windows machine with an uptodate .net installation, even then a cleaver user will be able to easily bypass anything you do to attempt to control the system, and vista and win7's User account control will keep you from doing any of that stuff anyway, regardless.

but I digress.

If you really just want to know how to disable windows key shortcuts, just google C# Kiosk mode and you will get the results you need, there are lots of good articles.

Diamonddrake 397 Master Poster

If you carefully design an asynchronous code base for your twitter API you could easily convert it to synchronous on the surface by blocking calls until your async calls fire

I developed it synchronously first just to get the twitter api calls right, then I just added extra methods to the class to handle it Asynchronously, and I'm really satisfied with that. Now I just have to extend the class to all the other API calls...

although I'm not sure the way I have started it is the best way to go about it, might have been better to have a twitter object that created child objects of each general subject from the API (user_timeline, Friends_timeline, Status, Update, ect) and put the code fore each different part in there, so that way using the code would be much more organized.

Diamonddrake 397 Master Poster

Leave it to sknake to go all out! Best of luck on your application ddanbe!

Diamonddrake 397 Master Poster

Thanks,

firstly, I manually created the thread because I have no Idea what I am doing. Threading is so new to me. I have used the backgroundworker class before, as it handles it all for you and even accepts and returns and object by default. but I needed a direct implementation any my gui was freezing during http requests.

you know, I never did get that whole anonymous delegate thing, so I still invoke on my main thread's event handler using

this.Invoke(new UpdateTextCallback(this.UpdateText), new object[] { e.TimeLine_Statuses });

then create a delegate and a method

        public delegate void UpdateTextCallback(statuses text);

        private void UpdateText(statuses text)
        {            statuses twitStatuses = text;

            foreach (statusesStatus stats in twitStatuses.status)
            {
                richTextBox1.Text = richTextBox1.Text + "\n" + stats.text + " - user: " + stats.user[0].name;
            }
        }

but I will try that anonymous approach.

Also, I didn't really understand why in your link that you only did the read response stream in Async and not the entire request. But either way I needed more, my http request ironically also a twitter api wrapper, makes a request for a user's "friendtimeline" and receives the xml, then deserializes it based on a schema class and returns that "statuses" object to the UI where it can easily get any information about the post.

I got both the synchronous and Asynchronous methods in my class when I get to using it in my newest hobby project I will be able to choose which best suits …

Diamonddrake 397 Master Poster

Thanks jerry, but calling the event from the 2nd thread always fails in my code. but I guess its because I haven't disabled the cross thread warnings.

I really don't like having to check if an invoke is required in the event handler on the form, I know an Invoke will always be required because that events exists in my code for the sole reason of threading. But I don't know how to get around it.

as I posted above, I did find a way to just run the methods asynchronously easy returning the data. but I still have the problem of having to invoke the response data in order to use it and I wish there was a way around it.

Diamonddrake 397 Master Poster

I managed to get it to work. I honestly really don't understand *how* it works, but I can implement the code behind doing it.

start()
{
Func<[I]Params[/I], [I]params[/I][I]returnValue[/I]> method = [I]Methodname[/I];
IAsyncResult res = method.BeginInvoke(Params, Params, new AsyncCallback([I]methodthatCatchesEndInvoke[/I]), [I]IDK object[/I]);
}

methodthatCatchesEndInvoke(IAsyncResult res)
{
[I]ReturnValue[/I] answer = method.EndInvoke(res);
}

I don't know any other way to do this. This works well, only problem is that you have to invoke the result again before you can even use it. And that makes it a lot of work to use. If anyone knows how to get around that. i would appreciate more information.

Diamonddrake 397 Master Poster

I have a class that in one of its methods creates a new thread that makes some http requests, serializes the results, packs them up in an event object and then it Should call broadcast an event returning its data. but I can't figure out how.

the class is not a form, so it doesn't have the invoke method, and I need to pass data back to the class. I'm stuck on this.

here is a stripped down version

class someclass
{
       public someclass()
      {

       }
//my event
     public delegate void onTimelineHandler(object sender ,TimelineArgs e);
     public event onTimelineHandler OnTimelineRecieved;

        private void TimelineAsyncStart(string url)
        {
            Thread myAsyncer = new Thread(new ParameterizedThreadStart(doTimelineAsync));

            string[] objar = new string[] { url, username, password };
            myAsyncer.Start(objar);
            
        }

 private void doTimelineAsync(object objar)
        {

            string[] sa2 = (string[])objar;
            string url = sa2[0];
            string username = sa2[1];
            string password = sa2[2];

          //some stuff happens here

             TimelineArgs targs = new TimelineArgs(myobject);

          [B]//here I need to call the event on the class that created    this thread, passing to that event the TImelineArgs object.[/B]

        }


]

I could really use some help on this, threading is not my things, I learned using background worker, guess I could have done that here, but really i would like to know how this is done.

Diamonddrake 397 Master Poster

He guys, thanks.
Your replies are much appreciated!
But I still have a problem.
If I use DiamondDrake's code, it works but now I have flashing blue red rectangles one sec after the other.
This is of course caused by the last Refresh, can this be avoided?
If I leave it out I get a busy cursor and a form not responding message if I click on the form.

here is the thing. you are animating the effect from within the paint event, and that is typically not a good idea.

a better approach would be to create a bool value like idk, Bool red = false; local to the class, then in the paint event of the form, if its true paint it red and if its false paint it blue.

then use a timer to change the value after 1000ms and call refresh just after it change the bool and stop the timer. then you have a blue panel until the timer ticks, it will then after be red.

of course when you start the timer is up to you....
really. It would help if you told me your actual intended use. that way I could help you with a better solution.

Diamonddrake 397 Master Poster

Of course you shouldn't invalidate the entire form, you would get the object that is being repainted using the sender property and call invalidate on that.

I was sure this was just pseudo code, or else I might have gone into more details. But in the example danny posted there is a good chance if you just invalidated the rectangles that windows won't get around to updating them before that second is up, so it was yield the same result. or just flash blue then flush red. that's why i just used refresh()

And although its often considered best practice to use invalidate so windows can paint it when its good and ready, often when the effect you want is a blinking or fading effect based on a interval, using refresh on that area will topically yield a better visual result at the cost of some extra system resources. So I find that if i am focusing on an effect that I really want to look good, that I will put it in its own control, and refresh that entire control as necessary.

Also, a timer control would probably work just fine for an alternating color or fading type effect, creating a new thread would work too.

*off topic*
when I first learned flash actionscript I had a lot of trouble with events, as when you called an event from an object for example a movieclip used as a button, in its onRelease handler, the …

Diamonddrake 397 Master Poster

that my friend is because you are sleeping the thread before the paint event is finished, this means windows is never told by your program that it wants be be repainted, and since nothing you are doing outside of your program is encouraging windows to repaint your program, it just draws a blue rect, but windows never updates your control before it gets painted red.

here you could call This.Invalidate(true) here, but since you are sleeping the thread, a better approach would be calling this.Refresh();

using System.Drawing;
using System.Threading;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void panel1_Paint(object sender, PaintEventArgs e)
        {
            Graphics G = e.Graphics;
            Rectangle R = new Rectangle(10, 10, 50, 50);
            G.FillRectangle(new SolidBrush(Color.Blue), R);
            This.Refresh(); //tells windows to repaint the form
            Thread.Sleep(1000);
            G.FillRectangle(new SolidBrush(Color.Red), R);
            This.Refresh(); //tells windows to repaint the form again,
             //ensuring that your one second wait period is not
            //extended by a busy system.
        }
    }
}
ddanbe commented: clarifing something about Sleep! +5
Diamonddrake 397 Master Poster

None of these are actually Peer-to-Peer. P2P Chat would be connectionless, therefore its is not a client/server model. True P2P Chat would be an application on a host PC that would broadcast itself on a unique port and not caring which other host PC receives and processes the information, doing the same for messages it sends - Hence, Connectionless. This would require use of the UDP Routed protocol.

Just my 2 cents.

even UDP typically uses connections. and most routers, especially the ones that your ISP uses to provide your connections will not pass on packets that have no definite endpoint attached to them. So if you use that method, then you are not going to get out of your local network, might fly in a large building with all private equipment. but not over the internet.

the standard is, if its not bound to an endpoint, then its noise, and squelch it! Its basic network coding theory. I have read it in 3 networking books, including the one that ddanbe posted a link to in a different recent thread.

Diamonddrake 397 Master Poster

straight from Wikipedia
"A pure P2P network does not have the notion of clients or servers but only equal peer nodes that simultaneously function as both "clients" and "servers" to the other nodes on the network. "

If you have any idea on how the internet works, you would understand that in order for computers to communicate they have to know where each other are, and in the case of TCP. the only real distinction between client and server is that the server is the first side to be contacted.

most p2p apps like kazza, frost wire, limewire, ect. have server somewhere they login to just so the other p2p clients know where to find each other. its just a big IP address and port sharing server.

now your p2p app has 2 basic threads running, (its more complicated in many but this is how the system works) the client thread starts making connections to all the available p2p apps, while its server thread is listening for connections from other p2p apps.

when someone uploads from you, its the server side of the app that sends out that information.

when you request files an download them TO your computer, its the client side of the app that receives the information.

just because the terms are client and server doesn't mean they meet the typical client/server model , they are all CLIENTS and they all SERVER each other.

Diamonddrake 397 Master Poster

for some reason, if you are logged on with the web messenger, or if you have any status other than the default available it shows false.

just paste

"http://mail.opi.yahoo.com/online?u=yourusername&m=t&t=1"

into a webbrowser and it will either show 01 or 00 on the screen, My class just checks for that.

also keep in mind that it should be the userID without the @yahoo.com

I used it when I had dial up internet to quickly check if my girlfriend was online as yahoo messenger often failed to connect. It was about 90% accurate, but that api is as simple as it could be, it was originally created so web designers or bloggers could easily have their website indicate if they were available on the messenger.

Diamonddrake 397 Master Poster

Seems you have almost answered your own question really. you obviously understand the difference. There is no right or wrong way to choose.

Static methods shorten code, typically a static method creates an object does some thing with it and returns a value, requiring a simple interface for a complicated task, but its certainly not limited to that.


an Danny is right, your first code block does look very strange, you can't instantiate an object from inside the object itself. but Im sure it was just a mock code for your point.

still. its entirely incorrect.