資源簡介
個人通訊錄系統, 基于C#編程,程序員在編程的過程中可以參考學習使用,希望對IT程序員有用,此源碼程序簡單易懂、方便閱讀,有很好的學習價值!

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.Configuration;
using?System.Data;
using?System.Linq;
using?System.Windows;
using?System.IO;
namespace?MyFriends
{
????///?
????///App.xaml的交互邏輯
????///?
????public?partial?class?App?:?Application
????{
????????private?string?xmlFilename?=?“MyFriends.xml“;
????????public?App?()
????{
????}
????????private?void?Application_Startup(object?sender?StartupEventArgs?e)
????????{
????????????//初始化全局應用程序屬性
????????????Application.Current.Properties[“SavedDetailsFileName“]?=?xmlFilename;//保存文件名
????????????Application.Current.Properties[“FullxmlPath“]?=?//完整的xml路徑
????????????????Path.Combine(Environment.CurrentDirectory?xmlFilename);
????????????Application.Current.Properties[“SaveFolder“]?=?//將要保存到的文件夾
????????????????Environment.CurrentDirectory;
????????????Application.Current.Properties[“SelectedDisplaystyle“]?=?//默認的顯示風格
????????????????Displaystyle.GrowShrink;
????????????if?(Directory.Exists(@“C:\WINDOWS\Web\Wallpaper“))
????????????????//設置默認的選擇圖片路徑的文件夾
????????????????Application.Current.Properties[“SelectedImagePath“]?=@“C:\WINDOWS\Web\Wallpaper“;
????????????else
????????????????Application.Current.Properties[“SelectedImagePath“]?=?@“C:\“;
????????????//設置免費的Exceed的Grid的授權序列號,需要將這里更改為自己的序列號???????
????????????Xceed.Wpf.DataGrid.Licenser.LicenseKey?=?“DGP30-E852N-G9C6E-DW5A“;
????????????//返回一個FriendsList對象的實例
????????????FriendsList.Instance();
????????}
????????private?void?Application_Exit(object?sender?ExitEventArgs?e)
????????{
????????????try
????????????{//SaveOnExit方法將當前的所有聯系人保存到xml文件中
????????????????xmlFileOperations.SaveOnExit();
????????????}
????????????catch
????????????{//如果保存失敗,顯示失敗信息
????????????????MessageBox.Show(“保存文件時失敗!“);
????????????}
????????}
????????
????}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????869348??2008-08-15?15:02??Xceed.Wpf.DataGrid.xm
-----------?---------??----------?-----??----
???????????????869348????????????????????1
- 上一篇:C# 在線留言簿系統
- 下一篇:C#推箱子小游戲
評論
共有 條評論