|
FormatName is one of the options when creating a messagequeue. I have had the best luck with it, so that is what I use.
Ben
|
|
|
|
|
Still my error is not rectified please give me the code to create the message queue or else give me some references.
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
I guess I would need more detail to understand your program to try to help more.
You are trying to put a message on a queue that is on a different computer then the one your program is running on? Or are they on the same computer?
If you are going to a different computer, you need to make sure the user will have rights on the other computer. Although, almost anyone should be able to put a message on the queue if you have a public queue.
Looking at your error message again. It looks like it is not able to resolve the name to the queue. NOrmally I have saved queue names in a web.config or app.config file. I am not sure what is coming back from your call to:
System.Net.Dns.GetHostName()
if there are slashes \\ then they need to be removed.
Hope that helps.
Ben
|
|
|
|
|
Hai Ben,
Warm Greetings!
Thank you for your kind reply.
kubben wrote: System.Net.Dns.GetHostName()
if there are slashes \\ then they need to be removed.
It is giving only the system name without any slashes.
It i want to store it in the app.config file how can i perform this.
Can you please give me the code to create and instantiate the queue and send message to the queue.
Please i don't want the full coding but i want to know it clearly so only i am asking you it is very very urgent.
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
One more thing to check and then I will give you the code I use. The queue name is case sensitive. So whatever you created the queue name to be that is what it needs to be in your code.
Ben
|
|
|
|
|
Ok here is the code:
//outbound queue
String outQueue = ConfigurationSettings.AppSettings["outboundQ"].ToString();
// using formatname we cannot check if the queue exists.
_outboundQueue = new MessageQueue(outQueue);
//config file:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<!-- Queues must be named "FormatName:DIRECT=OS:<machineName>\Private$\queueName" -->
<add key="outboundQ" value="FormatName:DIRECT=OS:server01\Private$\Importer.Inbound" />
Hope that helps.
Ben
|
|
|
|
|
Dear Ben,
Thank you lot for helping me to rectify the error.
I have fixed up the issue and it is working fine.
Once again thank you a lot.
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
Glad you figured it out.
Ben
|
|
|
|
|
I have simple project and i can't access serial port (RS232) using C#.NET, could somebody help me to give a simple example code ?
thanks
suprapto
|
|
|
|
|
|
Are you aware the CodeProject holds more than 1000 articles, some very good ones ?
A simple search would give many examples.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
hi i am facing with one problem
in c# windos application i created the five list boxes .Each listbox havie some same fildes.
if i select one item in one box tht wont repeate again the remining the drodown boxes.what cani ido pls inform that one to me
ok
regards,
vikramk1410@gmail.com
kommineni vikram
|
|
|
|
|
Ur question is very un-clear.. it doesnt suggest wat u r trying to do and wat is the problem..
better write ur prob in points rather to use single sentence, like wat u r doing, wat u want to do and wat the problem is
Regards
SG (sgg245@yahoo.co.in)
|
|
|
|
|
Hi,
Ur adding same fields in all the five list boxes. U create a procedure for this procedure with a parameter string. While loading the program call it with null string. While selecting a ddl call it with the selected string. Inside the prcedure u check the parameter and if it null add all to all ddls else all all except the string... IS it a solution to ur problem..
Regards
Kabeer V H
kabeervh@yahoo.com
im kabeer vh
|
|
|
|
|
Hello all,
I have two Bitmap objects, and I want to get the storage/file size of these bitmaps without having to save them on the file system.
I can get a file size if it is saved on the hard disk, so I can save the bitmaps then get their size in byte... However, I need a more efficient way: getting the size while the objects are in memory.
I hope my question is clear!
Naimi
|
|
|
|
|
the file size of a BMP size directly relates to the bitmap's dimensions.
I guess the relationship is bytes = a * wid * hei + b
a few experiments will tell you what the values for a and b should be.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Hi Luc,
Both files have the same dimensions.
When I save the files as gif, I get different sizes - that is what I am looking for.
Is there a way to get the size of the images as if they were saved as gif files? (without actually saving them!).
What i'm trying to do is to compare two images, and find out if they were identical. Of course, this is a terrible way to do it, however, I need the fastest method (because I have so many images). Plus, it is not a critical matter, so if some images were mistakenly identified as the identical, that is not a big deal.
Any ideas?
|
|
|
|
|
Hi,
BMP files are uncompressed, that's why their sizes directly relate to image dimensions.
GIF files are LZW-compressed, hence you can't predict the file size.
If you don't want to save to disk, you can also save to a (memory) stream.
However it remains an expensive operation.
Now you are asking a completely different matter: image comparison.
When do you consider two images identical? is it you have two Bitmap instances,
and their dimensions, and all pixel values are identical ?
or is it they both show the Liberty Statue ?
or something in the middle ?
If you want to check for identical pixel content, this is what I would do assuming
a large number of images:
- create a dictionary (or Hashtable)
- now iterate over all your images, one by one.
for each image, create your own hash code; I suggest a function of
image width W, image height H, ARGB value of pixel (10,10) and pixel (W/2, H/2) and
pixel (W-10,H-10).
ARGB value is the result of Color.ToArgb()
That was 5 values; you could do hash=(hash<<1)^newNumber for each of them,
starting with zero (^ is exor operator)
- check dictionary for presence of hash code; if not, create a new List (or ArrayList),
add (hash, list) to dictionary, and add image to the new list
if hash already existed, you found a possible match and you now must compare the image
with all images in the list checking all pixels.
To do that, use lockbits and pointers (look it up in MSDN
and read CodeProject articles on image processing by Christian Graus).
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Hello,
Here I'd like to have an advise with something that kept me busy for days and that I couldn't make work.
I'd like to use the EnvDTE.ExecuteCommand("File.Checkin"), and all the commands related to scc (File.AddtoSourceControl, etc ...). But I'd like to know if it's possible (and if yes, how to choose the file that we want to checkin (maybe using a parameter), because with these commands it always refers to the file where the code executes, and that's not what I want, as I have to deal with some files in this code.
If it's not possible, how can we use the SCC functions directly in C#, because our program may execute in different environments where different SCC providers could be installed (VSS, Clearcase, etc ...), and it would be so cool to use one unique code to deal with theses SCC, if it's possible, using the native SCC code.
The last possibility would be to implement the different COM components of the SCC, and to refer on the Register SCCprovider key to know which one to use, but if something easier could be done I would be so happy
Maybe another solution exists that I'm not aware of ?
Anyway, thanks.
François
|
|
|
|
|
I am working on a project in which I have to Log Off the locked computer. I use SessionSwitch to listen the windows locked event, and I used ExitWindows(0,0) to Log Off.
But this API function is not working on the Locked computer.
Another stratagy is to first unlock the computer and then use ExitWindows(0,0) to Log Off.But unfortunatly I am unable to Unlock the windows. Kindly help me to solve my problem.
|
|
|
|
|
I m using a status bar in the form.
In one of the panels of the status bar, I just want set the status of the CAPSLOCK & NUMLOCK, the same way it can be done in VB. But in VB the panel properties has different display value, so it was easy.
How this can be achieved in C#???
Thanks in advance...
Regards
SG (sgg245@yahoo.co.in)
|
|
|
|
|
The properties Console.CapsLock and Console.NumberLock provide the necessary information.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Thanks so much. Its working.
But stil a prob.
This is when the application start it detects if the CAPSLOCK is ON then I can display certain msg or so...
But I want whenever CAPSLOCK button is pressed then it should update the status of the panel in the status bar.
If CAPSLOCK is ON then status bar panel should show ON.
If CAPSLOCK is toggled i.e. OFF then status bar panel should show OFF.
Something like this...
Thanks in Advance...;) ;)
Regards
SG (sgg245@yahoo.co.in)
|
|
|
|
|
Hi,
there are at least two ways to keep your status bar up-to-date:
1. on your form, set KeyPreview true; then add an event handler for KeyDown;
the handler now will fire for every key moving down; in the handler check for Keys.CapsLock;
if it is, use Keyboard.CapsLock and update the status bar; don't try to count the toggles
yourself !
2. on your form, add a Windows.Forms.Timer and let it fire say every second;
in its Tick handler read Keyboard.CapsLock and update status bar.
The choice is yours, it depends a bit on which of those handlers you may already have
for some other reason.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Thanks very much.
I anticipated something like we used to do in VB status bar panels...
Anyways, again thanks for ur help... so kind of u...
Regards
SG (sgg245@yahoo.co.in)
|
|
|
|