|
|
Hey All! ,
Over the past coupla months I've read alot about TCP/IP and
System.Net.Sockets etc and I made my own little server/client application. Simple. One connects the other listens and receives messages. All works fine on my end (testing). BUT, to my surprise, it never works on anybody elses computer. I give them the client, and I use my server to listen, and they can never end up connecting to my server. They always get a "Server took way way way too long to respond" and similar error messages. . I tried reading a little more about it and nothing I had read helped solve the problem. So, I turned to my second best friend (Google) and found about 20 sample client/server applications that I downloaded and tested. They all worked perfectly on my own computer. But when I got friends to test, same old story... Couldn't connect. My friends have DSL Internet. Does this matter? Can anybody help shed a little light on this? I'd appreciate any help I can get on this.
lots of thanks,
jay
foreach( inch on Jason )
{
Girlfriend.IsHappier();
}
|
|
|
|
|
Are there firewalls in between blocking the connection?
|
|
|
|
|
Well, I don't know if they are blocking the connection. But now that you've mentioned it. That must be the case since we're all using anti-virus software with their own Firewalls. I use ESET Smart Security. And my friends are using AVG and Norton's. Maybe there's a way to get around the firewall's without disabling them?
foreach( inch on Jason )
{
Girlfriend.IsHappier();
}
|
|
|
|
|
If it is a firewall issue, ensure that the port of your service is open on the firewall(s).
You can also cheat and use a common port so long as you are not already using that service. e.g. If you don't have a web server installed on your computer you can use port 80 as firewalls typically keep that one open.
|
|
|
|
|
Oh. Awesome. It worked. Thanks so much for that!!!
Jay.
foreach( inch on Jason )
{
Girlfriend.IsHappier();
}
|
|
|
|
|
Hy!
I have multimedia keys on my laptop, just like most of us. These keys make Winamp/iTunis/GOMPlayer and so play/pause, etc. I want to make an application that does just the same: makes multimedia applications play/pause, stop, etc.
Now as these keys work with more applications I suppose (though not sure) that they use a built-in .NET API or some other Windows functionality hidden in some DLL somewhere rather then controlling the hotkeys of the individual applications.
I want my application to be PC model independent, I don't mind having it only Vista compatible.
So can anyone recommend a good starting point, library, class or anything in fact that could get me started. I don't (really) need all of the code to be written for me, I just need something to get me started.
Thanks!
modified on Saturday, April 11, 2009 2:49 PM
For those who are reading the first post: original introductory sentence was: "I have multimedia keys on my laptop, just like most of us.", hence the discussions. Edited later not to upset all the "sensible" people around here.
And in fact whether you have or not multimedia keys on your keyboard/laptop is not even important as I am looking for a software solution that would make all commonly used media players controllable by software, via OS specific commands (if any) even on system without MM keys.
RESOLVED: Global Mouse and Keyboard Library[^] also simulates MultiMedia Key press events.
modified on Sunday, April 12, 2009 7:10 AM
|
|
|
|
|
jano_rajmond wrote: I have multimedia keys on my laptop, just like all of us.
Thats a bit of a generalisation there. I have a laptop without multimedia keys. It is called a business laptop. My mother's consumer laptop, however, does have multimedia keys.
|
|
|
|
|
Not to be offensive... but really... NOT the point and NOT the answer to the question.
|
|
|
|
|
jano_rajmond wrote: Not to be offensive... but really... NOT the point and NOT the answer to the question.
Likewise - Don't tell me what I have on my laptop, no offense of course.
I don't know if Enlish is your first language or not, but the phrase "just like all of us" tacked onto the end of a statement implies (or I've only ever heard it used to imply) that if the statement is not true for the listener/reader then he/she is somehow mentally deficient/wrong/retarded/idiotic/etc. I don't like being called that.
|
|
|
|
|
Yes... you not having multimedia controls on your laptop does make you deficient... of multimedia controls. You also are all the other words you mentioned, but not because of the absence of MM controls on your laptop but because you keep answering this post without really having anything REMOTELY RELATED to say about THE REAL QUESTION. So if you don't like being called "those things" stop acting accordingly.
P.S.: No, English is not my first language, but as you can see I speak it quite well. And please, I'm begging you, look up the phrase "just like all of us" in a dictionary!
|
|
|
|
|
jano_rajmond wrote: And please, I'm begging you, look up the phrase "just like all of us" in a dictionary!
You'll have to provide a link because I couldn't find it in a dictionary (on- or off- line). Idiomatic expressions often aren't in dictionaries unless you happen upon them through a specific word.
jano_rajmond wrote: You also are all the other words you mentioned, but not because of the absence of MM controls on your laptop but because you keep answering this post without really having anything REMOTELY RELATED to say about THE REAL QUESTION.
Note that I did mark my post as being "not an answer" so others can easily identify that it does not contain an answer.
I was mearly pointing out that in your original post you may reduce your chances of getting an answer because someone could have misinterpreted your opening statement as an implicit insult if the condition was false.
|
|
|
|
|
Colin Angus Mackay wrote: You'll have to provide a link because I couldn't find it in a dictionary (on- or off- line). Idiomatic expressions often aren't in dictionaries unless you happen upon them through a specific word.
Oh... well, I guess that is why you have no idea that is has absolutely no offensive connotations. I was hoping that those who didn't actually have the respective keys could just ignore that part, you know, like *normal* people do.
Colin Angus Mackay wrote: as an implicit insult
Yes, I head African-Americans rolling in "da hood" swearing and insulting each other using those exact words. I even heard that someone actually got shot for using the phrase "just like all of us" when it wasn't 100% true.
|
|
|
|
|
I have multimedia keys on my laptop, and I know how to use them, manually and programmatically.
And if I would not know, I would know how to find out in a matter of seconds.
This being the weekend, I take a few days off, just like all of us.
|
|
|
|
|
Well then, have a nice weekend!
If I knew the answer and someone was asking for it, I would just paste a link or something, and I would feel much better about myself in the weekend cause I helped someone who needed it... just like most of us.
|
|
|
|
|
I know of no library to do what you want - I chuck keyboards away if they have all the MM and internet key and buy a business keyboard.
Create and app and detect the keydown event on a form to identify the keys and deal with them the way you need to. Doesn't every developer have a test app where snippets are tried
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi!
How do I save CDATA Object in an XML file?
Thanks
|
|
|
|
|
CDATA is a type of node in an XML file, it isn't an object. You might like to rephrase your question.
|
|
|
|
|
HI all,
i'm trying to populate a panel with an array of picture but when i debug the program is so slow to download the picture in the panel.
i have this code snippet :
public partial class ArtLabel : Form
{
private System.Windows.Forms.PictureBox[] imgArray;
public static string ImageToShow;
private int NumOfFiles;
private string[] imgExtension;
public ArtLabel()
{
InitializeComponent();
panel1.VerticalScroll.Visible = true;
panel1.VerticalScroll.Enabled = true;
panel1.VerticalScroll.Value = panel1.VerticalScroll.Maximum;
}
private void ArtLabel_Load(object sender, EventArgs e)
{
GetPicture4(@"D:\\Music\\");
}
private bool ThumbnailCallback()
{
return false;
}
private void ARR(int cNumber, string exc)
{
int Xpos = 8;
int Ypos = 8;
Image img;
Image.GetThumbnailImageAbort myCallback =
new Image.GetThumbnailImageAbort(ThumbnailCallback);
imgArray = new System.Windows.Forms.PictureBox[cNumber];
for (int i = 0; i < cNumber; i++)
{
imgArray[i] = new System.Windows.Forms.PictureBox();
if (Xpos > 432)
{
Xpos = 8;
Ypos = Ypos + 72;
}
imgArray[i].Left = Xpos;
imgArray[i].Top = Ypos;
imgArray[i].Width = 64;
imgArray[i].Height = 64;
imgArray[i].Visible = true;
imgArray[i].SizeMode = PictureBoxSizeMode.StretchImage;
img = Image.FromFile(exc);
imgArray[i].Tag = exc;
imgArray[i].Click += new System.EventHandler(ClickImage);
imgArray[i].Image = img.GetThumbnailImage(64, 64, myCallback, IntPtr.Zero);
panel1.Controls.Add(imgArray[i]);
Application.DoEvents();
Xpos = Xpos + 72;
}
}
private List<string> GetPicture4(string Folder)
{
DirectoryInfo dir = new DirectoryInfo(Folder);
List<string> str = new List<string>();
FileInfo[] files = dir.GetFiles("*.jpg", SearchOption.AllDirectories);
int NumOfFiles = files.Length;
imgExtension = new string[NumOfFiles];
for (int i = 0; i < NumOfFiles; i++)
{
ARR(i, files[i].FullName);
str.Add(files[i].FullName);
}
return str;
}
private void ClickImage(Object sender, System.EventArgs e)
{
ImageToShow = ((System.Windows.Forms.PictureBox)sender).Tag.ToString();
Direcoty_Prova.ViewPicture f = new Direcoty_Prova.ViewPicture();
f.ShowDialog();
}
}
My purpose of this code is to show the small label of Music Cd and after when i click on the small picture appear a new PictureBox with the picture in Real Size ,i can do it but the trouble if i wish store more than 30 picture in the Array of picture i must wait so long before that the form appear ,i don't know why.
Do you have any advice where i wrong in my code?
Thanks.
Nice Regards
|
|
|
|
|
ascotravel wrote: Do you have any advice where i wrong in my code?
yes.
1.
it is better to use Image.FromStream() rather than Image.FromFile() since the latter keeps the file locked. This is however not affecting performance AFAIK.
2.
it is much better to dispose of all objects you don't need any longer provided their class offers a public Dispose() method. Image class does, so don't just abandon img by assigning a new image to it, first do a if(img!null) img.Dispose(); That will reduce your memory consumption, reducing the work of the garbage collector.
3.
the basic idea of thumbnail images is you don't calculate them over and over; e.g. have your program create thumbnail files (with a modified filename), and look for them when loading. That will avoid the file load and the computation. For small images, avoid compressed formats such as JPEG; use BMP or GIF instead.
BTW: although some image formats support a built-in thumbnail, these are not always present. Furthermore the quality of GetThumbnailImage() is rumored to be not good.
|
|
|
|
|
Replace your ARR method with this:
private void ARR(int cNumber, string exc)
{
int Xpos = 8;
int Ypos = 8;
Image img;
Image.GetThumbnailImageAbort myCallback = new Image.GetThumbnailImageAbort(ThumbnailCallback);
imgArray = new System.Windows.Forms.PictureBox[cNumber];
imgArray[cNumber] = new System.Windows.Forms.PictureBox();
if (Xpos > 432)
{
Xpos = 8;
Ypos = Ypos + 72;
}
imgArray[cNumber].Left = Xpos;
imgArray[cNumber].Top = Ypos;
imgArray[cNumber].Width = 64;
imgArray[cNumber].Height = 64;
imgArray[cNumber].Visible = true;
imgArray[cNumber].SizeMode = PictureBoxSizeMode.StretchImage;
img = Image.FromFile(exc);
imgArray[cNumber].Tag = exc;
imgArray[cNumber].Click += new System.EventHandler(ClickImage);
imgArray[cNumber].Image = img.GetThumbnailImage(64, 64, myCallback, IntPtr.Zero);
panel1.Controls.Add(imgArray[cNumber]);
Xpos = Xpos + 72;
}
I've removed the loop, and the Application.DoEvents call. You were effectively creating the same PictureBoxes many times over
|
|
|
|
|
Hi Thanks to reply me so fast,
for Luc i will follow your advice as i'm a novice i need wise advice..Thanks
@Computafreak - Thanks to post the code but not luck .
When i debug the code in this line code :
<pre> imgArray[cNumber] = new System.Windows.Forms.PictureBox();
appear this error:"Index was outside the bounds of the array.".
I'm trying to work out it if i can i will post my solution.
Thanks a lot for your help.
Nice Regards
|
|
|
|
|
Hi,
If you remove the for loop from the ARR method you have to remove imgArray = new System.Windows.Forms.PictureBox[cNumber]; there as well, and allocate the array at the caller.
|
|
|
|
|
Hi Luc,
sorry i'm shame for my poor knowledge but i removed the loop For and i followed your advices but i receive always the same error .
What i do of wrong???
EDIT : if i remove <code>imgArray = new System.Windows.Forms.PictureBox[cNumber]; and after i debug in this code line
imgArray[cNumber] = new System.Windows.Forms.PictureBox();
i receive this error "Object reference not set to an instance of an object."
modified on Saturday, April 11, 2009 2:22 PM
|
|
|
|
|
Whoops. I missed that one. Follow the instructions at this link
|
|
|
|