tags:

views:

103

answers:

2

hi all

I dont know what exactly i have to type in title for this ,i tried my best

anyway coming to topic

I am making one acc checker for that purpose ,i am sending user and pass from my bsskinedit1 and bsskinedit2

here is my code

s:='http:\\site.com..premlogin='+bsskinedit.text+'&password='+bsskinedit2.text

but it giving some error ,then i used showmessage whats wrong with it then i came with strange result

see below

alt text

observer after 4 & and p combining together and appearing as a some new symbol :(

can any one tell me why its coming like this ?

+4  A: 

Your code (where you build the URL) is most likely correct (I guess the above has some typos?!), but when you display the URL in a label for instance, the & character is treated as indicator for an accelerator key.

By Windows design, accelerator keys enable the user to access a menu command from the keyboard by pressing Alt along the appropriate letter, indicated in your code by the preceding ampersand (&). The character after the and sign (&) appears underlined in the menu.

If you want to display the & character itself, you have to set your string variable to &&.

By placing two ampesands together - you state that the character following the first one is not used as the accelerator - rather you actually want to get it (only one) displayed.

Just use your debugger if you want to see the real value that your string variables have, don't output them to a message box or the like... It may have side effects, as you can see.

Regarding the URL you build: I can't possibly know how it has to be correctly, but at least you should use the right slashes!

s := 'http://site.com...'

(All quotes from delphi.about.com)

Mef
+1  A: 

In addition to what Mef said, you can use OutputDebugString to add your string to the event log in its raw form, so you don't need to modify it before displaying it. Delphi should capture those strings automatically if you're running from the debugger. If you aren't running it from Delphi you can use DebugView instead, which captures the messages from any running applications.

Craig Peterson