✔ 最佳答案
Save the user setting in the registry or an external source, e.g., database. The registry is your best bet. When the form opens, read the registry and load the value onto the form.
Look up .NET framework documentaion on Microsoft.Win32
RegistryKey Class, SetValue and GetValue method.
Simple example:
' Set Value
Dim rk As RegistryKey = Registry.LocalMachine.CreateSubKey("YourSection\\YourSubsection")
rk.SetValue("StringValue", "Your String Value Here")
' Retrieve Value
Dim rk As RegistryKey = Registry.LocalMachine.OpenSubKey("YourSection\\YourSubsection")
x = rk.GetValue("StringValue").ToString()
2007-08-31 02:42:48 補充:
Dim newMail As MailMessage = New MailMessage();newMail.From = anewMail.To = bnewMail.Subject = cnewMail.Body = dnewMail.Attachments.Add(New MailAttachment("c:\filt1.txt", MailEncoding.UUEncode))SmtpMail.Send(newMail)
2007-09-01 07:25:52 補充:
程式我 沒有測試過,最好是參考.net的documentation. VB2005 Express跟 Visual Studio 2005在.net framework編譯上應該是沒有分別的.
2007-09-01 07:30:44 補充:
屬性會被使用者更改,應在FormClosing 事件來寫入registry.