|
i'm using a msmq for my application and i create a queue when the application is loading.And to receive the message i set the timespan for 10, in the debug mode it works fine and the messages received as expected, but when i deploy the application in the release mode it gives a "timeout exception" at the receive method.
i would really appreciate your ideas about this .
thanks in advance.
|
|
|
|
|
If there are no messages in queue then it will raise tiemout exception.
No need to worry about that exception .. just catch it and say there are no messages in 'Q'.
No Defeat Is Final Until You Stop Trying!.......
|
|
|
|
|
You should also possibly increase your timeout (or at least make it configurable)
Or start another thread/method etc. to listen for the next message.
|
|
|
|
|
Hi,
I don't know much about icons and bitmaps so please bear with me.
I have a .ico file and several .png files provided to me. The code I have overlays the .png file to indicate a status. The code seems to work fine right up to the point that it gets an icon. The icon doesn't quite look right though it's hard to see in the system tray.
So I changed the code to write it out to a file and now it seems to look even worse (looks like a very small colour pallette) so I don't know if it's the same issue.
Here's a photo of the two files opened up on Visual Studio -
http://flickr.com/gp/psmithson/9s2KnQ
This is an extract of the code producing the two files -
Bitmap bmp = new Bitmap(stream);
bmp.Save("c:\\tmp\\stage1.ico");
IntPtr Hicon = bmp.GetHicon();
Icon icon = Icon.FromHandle(Hicon);
using (var fs = new FileStream("c:\\tmp\\stage2.ico", FileMode.Create, FileAccess.Write, FileShare.Delete))
{
int pgs = icon.Height;
icon.Save(fs);
}
The system tray icons don't look that bad but they're not quite right. Is there a limited pallette available in the system tray?
Thanks.
Peter.
|
|
|
|
|
This may be of help:
clickety[^]
Guy
Continuous effort - not strength or intelligence - is the key to unlocking our potential.(Winston Churchill)
|
|
|
|
|
Standard .ico icons do not support multi-level transparency. If your PNG overlay or generated bitmap contains that, strange things will happen. Saving to a .ico may well use a low colour depth by default.
I suspect the problem lies with where you are setting the system tray icon. That is a p/invoke if I remember right? Can you post the section where you set that (including setting up the image object that you assign to it)?
|
|
|
|
|
Transparency could be the main problem. The colours don't look so bad in the actual system tray but there is a black blob at the top right where it should be transparent.
I just dragged a NotifyIcon onto the form from the Toolbox under "Common Controls".
I get this generated -
this.notifyIcon = new System.Windows.Forms.NotifyIcon(this.components);
Then I just set the icon very simply -
notifyIcon.Icon = iconNoStatus;
The "iconNoStatus" is just an Icon that has been created using the code I posted initially.
Thanks.
|
|
|
|
|
Oh, I didn't know about that class. I guess that hides all the tricky bits.
I don't see anything in the Icon class that allows you to set colour depth – perhaps I am missing something?
|
|
|
|
|
Is there a way to transfer files to remote computer of different domain using remote server's username and password?(c#,console)
Thanks inadvance
No Defeat Is Final Until You Stop Trying!.......
|
|
|
|
|
Look at the FtpWebRequest Class[^]
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
Thanks for the reply..
is there any other ways other than Ftpwebrequest.. pls help me..
i have tried
1) MAP drive
2) NET USE
No Defeat Is Final Until You Stop Trying!.......
|
|
|
|
|
If you are looking for an off the shelf application, then I use FileZilla[^] - it's open source and works well.
You can't use MAP drive (AFIAK) unless the computer has a fixed IP address and share name - I've never tried that either, but in theory it should work.
NET USE will probably have the same problem.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
Thanks for the reply sir,
I want to achieve file transfer through c# console application by specifying remote system's domain,user name & password.
can it be done so..? pls help me..
No Defeat Is Final Until You Stop Trying!.......
|
|
|
|
|
The third example in the original link shows how to do that, I thought...
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
sir didn't get u.. third example ??
No Defeat Is Final Until You Stop Trying!.......
|
|
|
|
|
If you follow the first link I gave you, then scroll down.
After the "Remarks" section there are three examples: Deleting, downloading, and then uploading a file from a remote site via FTPWebRequest.
The example you want is the third of these, and is about 1/4 of the way down the whole page.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
sorry for the wrong communication.
i will explain it clearly.
Consider machinA and machineB.
- A & B are located on different domains.
- B is having a network share path(ex: \\192.168.10.12\d$)
- Now i want to transfer a file abc.txt from machineA to share path on MachineB.
I am trying with File.copy() method bt was failed with longon failure as the servers are located on different domains.
So, is there a way that if i know MachineB logon account(domain,username&password) can i be able to transfer file??
pls guide me a way to achieve this.
No Defeat Is Final Until You Stop Trying!.......
|
|
|
|
|
You need to impersonate the account in order to access the other domain. Had you searched Google, you'd have found this[^] article which does exactly what you are trying to do.
|
|
|
|
|
Thanks for the reply sir,
Yes i had gone through that Link earlier, but i was stuck at LongonUser() part.
Will it accept localuser account or remote server's user account?
which username,password&domain i should give?
No Defeat Is Final Until You Stop Trying!.......
|
|
|
|
|
You need to give it the remote account details - that's the user you are trying to impersonate. It's no use giving a local account.
By the way, please don't cross post. I just found the same question posted in Q&A - if you post in multiple places, it's hard to see what advice you have been given, and the missing nugget of information can get lost because we haven't seen the other post.
|
|
|
|
|
Sorry .. my apologies..
No Defeat Is Final Until You Stop Trying!.......
|
|
|
|
|
You are quite impatient guy. This is a double post!
If you would be a bit more patient, later on I could give you an example!
|
|
|
|
|
Sorry .. my apologies for the impatience..
No Defeat Is Final Until You Stop Trying!.......
|
|
|
|
|
I'm making a project in c# that looks like Paint.Net
i hace a panel in the middel of the form
(form size=900,500 panel size=800,400)
when i load a bigger picture like 801,401 and above
i don't want to increase the panel size instead i want to reduce the pic's pixel
so that will fit into the original panel size.
can someone help me with that ?
|
|
|
|
|
It's difficult to give you a simple answer to that, as there are a lot of factors that are involved.
How are you showing the picture in the panel? Hopefully, you are handling the Paint event, and drawing it yourself. If not, why not?
How do you want to show the picture? Zoomed? Stretched? Proportional to the panel size, or the original image size? (i.e. if the panel is 800 x 400 and the picture is 1000x1000, what do you show - all the pixels? All the pixels horizontally, and some of the vertical ones? Or something else?)
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|