|
Yes, you need to have a fixed-width font, like Courier New or Lucida Console. In such fonts, all characters - including space - have the same width, so it's easy to align things. Notepad uses a fixed-width font (it varies which depending on your version of Windows).
Most fonts are variable-width, where the width of a character depends on how much space it needs.
Compare the relative widths of these two strings:
"lililil"
"mumumum"
The yave the same number of characters, but the first will take up a lot less space in a variable-width font.
|
|
|
|
|
|
Hi
We need to encrypt a string and send across to a web service in C# over the internet. The webservice would decrpt the string and process it. How can I ensure that I use common encryption/decryption algorithms on both the client (C++, win32) and server side (C#)
I have tried to build a C++ dll with the enc/dec interfaces and give it to the C# service to call them using marshaling, but I am failing to get the desired result.
Please help
Thanks in advance
|
|
|
|
|
Use a standard algorithm. C#/.NET has a fair few in the System.Security.Cryptography namespace.
On the C++ side you just need to use the same algorithm. Check out Crypto++ for good and free implementations.
There is no need to have the exact same source code used in both C++ and C#, provided you use a well documented and standardised algorithm.
|
|
|
|
|
|
CAPICOM has been deprecated by Microsoft, and is not available on Windows 7. I wouldn't use it myself since it's limited in capability and a bit of a mess to use, if I recall correctly (haven't looked at it for years).
Oh, it says here that "only CAPICOM can decrypt a CAPICOM EncryptedData object" which would rule it out for you, if you need it to interop with C# (unless you wrap it in a DLL and call that from the server - was that what you tried?)
Since they recommend you use .NET crypto for any new development, you might as well create a simple DLL in C# or C++/CLI that exposes the same to the desktop application. (Which is the opposite of what you've tried already, but this way around it's likely easier to test and debug on a desktop.)
|
|
|
|
|
Thanx Orjan
I will try that out
|
|
|
|
|
You could also look at Cryptography API: Next Generation[^] which is the replacement for CAPI. I have no idea how 'good' it is, but I do know that the .NET framework has some CNG implementations of various standard algorithms.
Though, I must admit, it might just be easier to write the C# dll and interop with that.
|
|
|
|
|
Hi,
I am using a client socket to recieve messeges. If I click on stop button, a message is sent to serverwhich tells dont sent more messages but in the meantime server has sent 1000 of messages which I need not to recieve?
I need to flush all messages which has sent by the server after pressing STOP button and recieve only last message i.e server response againest STOP message. How to implement it?
|
|
|
|
|
Set a flag for the client socket: 'discardAllButTheStopAnswer ' would be a good name.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Like C-Pallini is already implying, flushing the messages just means receiving them in your application and then choosing to not do anything with them (discarding), until you reach the STOP message. In other words, after pressing the Stop button you need to at least keep receiving the messages until the STOP message arrives.
|
|
|
|
|
Is is possible to create a dbx file from number of eml file programatically?
|
|
|
|
|
Anything is possible if you know the file format.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
what is result of the formula?
1 & 0x01+1*3
it is zero actually.
I guess it equals 1&(0x01+1*3).
I need a priority table of C operators to know c operators' priority for +-*/&|~%
normally, * and / are executed before + and -.
how about others, do you have a link for this?
|
|
|
|
|
Your guess is right: here you are "C++ Operator Precedence"[^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi all,
I want to store values from a file into a map (which I have selected) with three fields, namely number, name, model. With map can I do that? Since I can use a value pair how can I handle the third parameter.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
Pack name , model into a struct or alternatively, into a std::pair .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Of course. That solved my issue.
Thanks!
I appreciate your help all the time...
CodingLover
|
|
|
|
|
You are welcome.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Sure,you just want to change the resouse of the picture.
|
|
|
|
|
|
Actually the number is the key, and I used struct for the rest.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
Hi,
Does anyone know how to open files as read-only in VS2008 like you used to be able to do in VC++6.0? The number of times I have edited the wrong file, saved it and screwed up a totally different project
There is a drop-arrow on the Open button but it doesnt do anything.
Ta
|
|
|
|
|
Apply 'Read Only' property to all the files/folder you don't wanna to change.
|
|
|
|
|
Hi all,
I want to read a user input with spaces, say "Hello World". With scanf how can i do that. Because all the time after the space, I cannot read the input.
scanf("%[^\n]", name);
scanf("%s",&name);
fscanf(stdin, "%*s%99[^\n]", name);
None of the above solve my issue.
I appreciate your help all the time...
CodingLover
|
|
|
|