The short answer would be:
myString = myTextBox.Text
You should always use full type name when asking such questions, and tag the UI library you use. Also, you should mark exact line in your code where the compiler finds an error. Nobody want to waste time on guesswork.
From this code, I can see you are storing the password directly. This is unsafe and never ever should be done. Nobody but the user should ever know the password, even the person with full access to the system. It is never needed for authentication. One of the approaches is using
cryptographic hash function:
http://en.wikipedia.org/wiki/Cryptographic_hash_function[
^].
You always compare hash to stored hash, never a password. It is not feasible to get a password from known hash.
Please see my past answers:
verify user name and password in c# form[
^],
How to Store a Password[
^],
Password saving .NET[
^].
Also, you are using path name "d:/images". It will work only on one computer and illegal on systems like Windows 7. There are no situations where a hard-coded path name can be useful, ever. All path names are always calculated during run time based on location of assembly, special directories or some configuration data.
—SA