It is generally not the best idea to leave your code to default to regional settings when you are expecting something specific from your results, as you are in this case. You can tell .net to use a specific culture when you do your ToString and you always get the format of that culture.
However given you want a literal slash due to you creating a file path you're better with the escaping example provided in other post as that makes it unambiguous that you need a literal slash, ie for a path.
Another way to eliminate problems caused by variant cultures is to use the IFormatter versions of ToString() etc. When dealing with file names, data stored in files, etc., specify CultureInfo.InvariantCulture. When displaying dates, integers, etc., specify CultureInfo.CurrentUICulture.
This gives you the best of both worlds - data interchange will work irrespective of the UI culture, and data will always be displayed in the current culture's preferred format.
If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack.
i have a server and many clients, the clients send a lot of request to server
i must keep them into a repository(queue) and do them.
i need to a solution or pattern for when one of the request get exception or be failed , move to another queue and if in second queue get exception again go to another queue(just 3 level)
now I'll know how to management it
thanks for your answer
i need to a pattern for manage my queue
for example my clients send requests to server and server tell to them i do it and you can continue,
now i must create a repository(include two or three queue) for hold the requests
the severe have a windows service that call queue and process the request
i think it's clear , but what is my problem?
for example the requests connect to each server for get data ,note i have a lot of requests
now i need to a pattern or algorithm that when a request for each reason be failed (for example time out or server is shut down for two hours or ...)
move the request to second queue (because if it stay in first queue,my queue be long and response to other requests be difficult) and i must define a scheduler for second queue and again process the request if get error again move to third queue. and define a scheduler for third queue with low priority
implement it is my problem
i need to a pattern for identification the requests be failed
witch one is better two queue or one queue?
how to scheduler each queue ? (for example first queue must run non-stop and second queue what time must run)
when a request form fist queue move to second queue after scheduler do process again or move to first queue
I can't help you identify "requests that fail" - I have no idea what causes a request to fail, or how you detect it (remember, I can't see your screen or access your hard drive) - but as to the number of queues, that's easy.
Use multiple queues.
Have a "standard feed" queue, and move "failed" items to the "first generation failure" queue. If they fail again, move them to a "second generation failure" queue. (Use Locking to ensure thread safety while adding to or removing from a queue)
And have background tasks that periodically check the queue and retry. If the queue is empty, then it waits a while before looking again.
I'd probably add a timestamp to the "failure" queue, so I don't retry for a reasonable time, increasing with each generation.
But that isn't a pattern!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
Uhhh....there is no "rest of it". That code would be the bulk of your server and services! It's not possible for anyone else to write your code because none of us has any idea what you're doing, what types of messages your clients are supposed to be sending, what processing you need to do on these messages, what your validation and failure points are, what processing you need to do on a failed message, ... NOTHING.
The only person who's going to be able to write your code is YOU.
If you want examples on how to work with MSMQ, just Google for "C# MSMQ tutorials".
I just published an article on custom-drawing a Button control from scratch in Windows Forms, and after I published it, I found a link on this website that said that some articles are still in Pending status for a whole year due to being understaffed. Is that still the case?
I'm kind of scared right now. I don't want to wait a whole year!
How long do new articles usually take to get approved these days?
Okay. Imagine this. You are sitting in a car waiting for your daughter's keyboard lesson to finish. You think you have some spare time to answer questions. Now picture your screen. How likely is it that someone sitting in a car can even begin to answer. In other words, you need to tell us what your code is doing. What errors you're seeing and so on.
OK. Your code is broken, so debug it, find out why it's not working and fix it!
There, you've been guided.
Really, what did you expect for an answer given the complete lack of information in your original post? We can't see your screen, your code, your hard drive, nothing. We have to rely entirely on what you put in your post to try and help with and what did you give us to work with? NOTHING.