skyyakal Posted October 28, 2003 Posted October 28, 2003 Hallo everybody. In my program I put the Option Strict On, so I program a "cleaner" VB Code. Now I have to write some data to a text file. Reading from it gives me String values only. I hope, I'm right on that point. Giving the String values back to Integer variables requeres convertion of this values from String to Integer. Is there any way to convert without switching to Option Strict Off?!?! If not. How can I save Integer to a File and get it back to variables?! ADDITIONAL PROBLEM is, that after reading the file with values I have to work with split function. I don't think .Split would work with Reader.ReadLine. Quote
*Experts* mutant Posted October 28, 2003 *Experts* Posted October 28, 2003 You can use the Convert class. For example: Dim s as string = "234" Dim i as integer = Convert.ToInt32(s) Quote
skyyakal Posted October 28, 2003 Author Posted October 28, 2003 thank you mutant!!! I will try now Quote
skyyakal Posted October 28, 2003 Author Posted October 28, 2003 Hallo mutant. It has worked. Thanks a lot! I have another question. I saved the Color object to file like System.Drawing.Color.ToString How can I convert the String back to Drawing.Color?! I know there are Color.FromName(ColorString) Method. But if there is an ARGB Color, do I have to extract each of 4 ARGB values from String, convert it to Integer and then use Color.FromARGB? Or is there another function, that could do it directly? Thank you for your time in advance!!! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.