PDA

View Full Version : مبتدی: ذخیره اطلاعات در VB



sa1378
جمعه 19 اردیبهشت 1393, 16:54 عصر
سلام
من میخوام یه برنامه درست کنم که توش یه سری خونه های حافظه رو با Dim تعریف کردم
میخوام وقتی از برنامه میریم بیرون و دوباره وارد میشیم اون اطلاعات وجود داشته باشن
و یه command هم بذارم که هر وقت خواستی باهاش اطلاعات رو پاک کنی؟
چجوری میشه اینکارو کرد؟

arash21hhhh
شنبه 20 اردیبهشت 1393, 11:49 صبح
سلام .
هم میتونید از savesetting استفاده کنید .
هم اطلاعاتو تو یه فایل متنی بریزید و بخونید .
هم از my.setting.... استفاده کنید.
در مورد گزینه سوم نحوه ساخت setting از سایت مایکروسافت
Creating a Setting Let's assume you have a search box in your application and you want to store the value of the last item that was searched. First, let's create the UI for the application, as shown in Figure 2.
http://i.msdn.microsoft.com/dynimg/IC32764.gif
Figure 2. Creating the search box UI
Now, let's create the setting for the last searched item string. The completed search box will look like Figure 3.


In solution explorer, double-click My Project.
Click on the Settings tab to display the Settings Designer.
Enter a Name, Type, and Scope of the Setting ("LastSearchedItem", String, and User respectively).
In the Value column, enter the initial value for this setting (What would you like to search for?) or you can leave it blank. http://i.msdn.microsoft.com/dynimg/IC126736.gif