├── .vs ├── AduMusic │ └── v15 │ │ └── .suo ├── ProjectSettings.json ├── VSWorkspaceState.json └── slnx.sqlite ├── AduMusic ├── .vs │ └── AduMusic │ │ └── v15 │ │ ├── .suo │ │ └── Server │ │ └── sqlite3 │ │ ├── db.lock │ │ ├── storage.ide │ │ ├── storage.ide-shm │ │ └── storage.ide-wal ├── AduMusic.sln ├── AduMusic.v12.suo └── AduMusic │ ├── 128.ico │ ├── API │ └── PrivateMethod.cs │ ├── AduMusic.csproj │ ├── App.config │ ├── App.xaml │ ├── App.xaml.cs │ ├── Common │ ├── AsynchUtils.cs │ ├── CvUtils.cs │ └── FolderHelper.cs │ ├── Controls │ └── ImageRadioButton.cs │ ├── Fonts │ └── iconfont.ttf │ ├── Images │ ├── Background │ │ ├── Sys.png │ │ └── f3.jpg │ ├── ICON │ │ ├── 128.ico │ │ └── 48.ico │ └── Nor │ │ ├── Cover.png │ │ └── NorHeader.jpg │ ├── MainWindow.xaml │ ├── MainWindow.xaml.cs │ ├── MiniWindow.xaml │ ├── MiniWindow.xaml.cs │ ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings │ ├── Styles │ ├── Carousel │ │ ├── Carousel2DView.xaml │ │ ├── Carousel2DView.xaml.cs │ │ ├── ImageItem.xaml │ │ ├── ImageItem.xaml.cs │ │ └── InteractivePanel3D.cs │ ├── DataGrid.xaml │ ├── DataGridForSong.xaml │ ├── Expander.xaml │ ├── FormControl.xaml │ ├── ItemControlTemp.xaml │ ├── ListBox.xaml │ ├── ListView.xaml │ ├── Login.xaml │ ├── Menu.xaml │ ├── NorTheme.xaml │ ├── RadioButton.xaml │ ├── ScrollView.xaml │ ├── SelectDate.xaml │ ├── Style.xaml │ ├── TabControl.xaml │ ├── TabControl_Friend.xaml │ ├── TabControl_Home.xaml │ ├── WButton.xaml │ ├── WSSlider.xaml │ └── WSlider.xaml │ ├── UserLogin.xaml │ ├── UserLogin.xaml.cs │ ├── Views │ ├── Home.xaml │ ├── Home.xaml.cs │ ├── MusicList.xaml │ └── MusicList.xaml.cs │ └── bin │ └── DLLs │ └── 3DTools.dll ├── README.md └── ScreenShot ├── Cover (1).png └── Cover (2).png /.vs/AduMusic/v15/.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aduskin/AduMusic/91e4060ab291151ba47d18049063f6612f2dab23/.vs/AduMusic/v15/.suo -------------------------------------------------------------------------------- /.vs/ProjectSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "CurrentProjectSetting": null 3 | } -------------------------------------------------------------------------------- /.vs/VSWorkspaceState.json: -------------------------------------------------------------------------------- 1 | { 2 | "ExpandedNodes": [ 3 | "", 4 | "\\AduMusic", 5 | "\\AduMusic\\AduMusic", 6 | "\\AduMusic\\AduMusic\\obj", 7 | "\\AduMusic\\AduMusic\\obj\\Debug" 8 | ], 9 | "SelectedNode": "\\AduMusic\\AduMusic.sln", 10 | "PreviewInSolutionExplorer": false 11 | } -------------------------------------------------------------------------------- /.vs/slnx.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aduskin/AduMusic/91e4060ab291151ba47d18049063f6612f2dab23/.vs/slnx.sqlite -------------------------------------------------------------------------------- /AduMusic/.vs/AduMusic/v15/.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aduskin/AduMusic/91e4060ab291151ba47d18049063f6612f2dab23/AduMusic/.vs/AduMusic/v15/.suo -------------------------------------------------------------------------------- /AduMusic/.vs/AduMusic/v15/Server/sqlite3/db.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aduskin/AduMusic/91e4060ab291151ba47d18049063f6612f2dab23/AduMusic/.vs/AduMusic/v15/Server/sqlite3/db.lock -------------------------------------------------------------------------------- /AduMusic/.vs/AduMusic/v15/Server/sqlite3/storage.ide: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aduskin/AduMusic/91e4060ab291151ba47d18049063f6612f2dab23/AduMusic/.vs/AduMusic/v15/Server/sqlite3/storage.ide -------------------------------------------------------------------------------- /AduMusic/.vs/AduMusic/v15/Server/sqlite3/storage.ide-shm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aduskin/AduMusic/91e4060ab291151ba47d18049063f6612f2dab23/AduMusic/.vs/AduMusic/v15/Server/sqlite3/storage.ide-shm -------------------------------------------------------------------------------- /AduMusic/.vs/AduMusic/v15/Server/sqlite3/storage.ide-wal: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aduskin/AduMusic/91e4060ab291151ba47d18049063f6612f2dab23/AduMusic/.vs/AduMusic/v15/Server/sqlite3/storage.ide-wal -------------------------------------------------------------------------------- /AduMusic/AduMusic.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.21005.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AduMusic", "AduMusic\AduMusic.csproj", "{567C5328-B5ED-48B6-88EC-AC91FF5C924D}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {567C5328-B5ED-48B6-88EC-AC91FF5C924D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {567C5328-B5ED-48B6-88EC-AC91FF5C924D}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {567C5328-B5ED-48B6-88EC-AC91FF5C924D}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {567C5328-B5ED-48B6-88EC-AC91FF5C924D}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /AduMusic/AduMusic.v12.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aduskin/AduMusic/91e4060ab291151ba47d18049063f6612f2dab23/AduMusic/AduMusic.v12.suo -------------------------------------------------------------------------------- /AduMusic/AduMusic/128.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aduskin/AduMusic/91e4060ab291151ba47d18049063f6612f2dab23/AduMusic/AduMusic/128.ico -------------------------------------------------------------------------------- /AduMusic/AduMusic/API/PrivateMethod.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Drawing; 5 | using System.IO; 6 | using System.Drawing.Imaging; 7 | using System.Linq; 8 | using System.Net; 9 | using System.Text; 10 | using System.Threading.Tasks; 11 | using System.Windows; 12 | using System.Windows.Controls; 13 | using System.Windows.Interop; 14 | using System.Windows.Media.Imaging; 15 | 16 | namespace AduMusic.API 17 | { 18 | public static class PrivateMethod 19 | { 20 | public static BitmapSource GetImage(string url) 21 | { 22 | return ChangeBitmapToBitmapSource(GetNetImage(url)); 23 | } 24 | //根据网络获取一张图片 25 | public static System.Drawing.Bitmap GetNetImage(string url) 26 | { 27 | System.Drawing.Image Logo = null; 28 | System.Net.WebClient wb = new System.Net.WebClient(); 29 | Stream stream = wb.OpenRead(url); 30 | //网址自己改吧 31 | Logo = System.Drawing.Image.FromStream(stream); 32 | stream.Dispose(); stream.Close(); wb.Dispose(); 33 | return (System.Drawing.Bitmap)Logo; 34 | } 35 | /// 36 | /// 下载网络图片到本地 37 | /// 38 | /// 网络路径 39 | /// 文件夹名 40 | /// 41 | public static void DownNetImage(string url) 42 | { 43 | string fname = Path.GetFileName(url); 44 | string DirectoryPath = Environment.CurrentDirectory + "\\FMBackground\\"; 45 | string fileName = DirectoryPath + "xinli" + fname; 46 | if (!Directory.Exists(DirectoryPath)) 47 | { 48 | Directory.CreateDirectory(DirectoryPath); 49 | } 50 | if (!File.Exists(fileName)) 51 | { 52 | System.Net.WebClient wb = new System.Net.WebClient(); 53 | Stream stream = wb.OpenRead(url); 54 | //网址自己改吧 55 | System.Drawing.Image Logo = System.Drawing.Image.FromStream(stream); 56 | stream.Dispose(); wb.Dispose(); 57 | Logo.Save(fileName); 58 | } 59 | } 60 | //根据获取一张本地图片 61 | public static System.Drawing.Bitmap GetLocalImage(string url) 62 | { 63 | return null; 64 | } 65 | 66 | 67 | public static BitmapSource ChangeBitmapToBitmapSource(Bitmap bmp) 68 | { 69 | BitmapSource returnSource=null; 70 | App.DispatcherHelper.Invoke(new Action(() => 71 | { 72 | try 73 | { 74 | returnSource = Imaging.CreateBitmapSourceFromHBitmap(bmp.GetHbitmap(), IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions()); 75 | } 76 | catch 77 | { 78 | } 79 | })); 80 | return returnSource; 81 | } 82 | 83 | /// 84 | /// 下图片。缓存 85 | /// 86 | /// 87 | /// 88 | /// 89 | //public static void DownImage(string name, string path, Action action) 90 | //{ 91 | // Task.Factory.StartNew(() => { 92 | // string DirectoryPath = HTTP.RunPath + "images\\"; 93 | // string ImagePath = HTTP.RunPath + "images\\" + name; 94 | 95 | // if (!Directory.Exists(DirectoryPath)) 96 | // { 97 | // Directory.CreateDirectory(DirectoryPath); 98 | // } 99 | // if (!File.Exists(ImagePath)) 100 | // { 101 | // using (WebClient wb = new WebClient()) 102 | // { 103 | // wb.Headers.Add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"); 104 | // wb.Headers.Add("Accept-Encoding", "gzip, deflate, sdch"); 105 | // wb.Headers.Add("Cache-Control", "max-age=0"); 106 | // wb.Headers.Add("If-None-Match", "59cfaaac-56af"); 107 | // wb.Headers.Add("Host", "i.meizitu.net"); 108 | // wb.Headers.Add("Referer", "http://www.mzitu.com/"); 109 | // wb.DownloadFile(path, ImagePath); 110 | // } 111 | // } 112 | // action(ImagePath); 113 | // }); 114 | //} 115 | 116 | public static void DownImage(string DirectoryName, string Url) 117 | { 118 | //Task.Factory.StartNew(() => { 119 | //存储路径 120 | string DirectoryPath = System.Environment.CurrentDirectory + "\\FMBackground" + DirectoryName; 121 | 122 | if (!Directory.Exists(DirectoryPath)) 123 | { 124 | Directory.CreateDirectory(DirectoryPath); 125 | } 126 | if (!File.Exists(DirectoryPath)) 127 | { 128 | using (WebClient wb = new WebClient()) 129 | { 130 | wb.Headers.Add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8"); 131 | wb.Headers.Add("Accept-Encoding", "gzip, deflate"); 132 | wb.Headers.Add("Cache-Control", "max-age=0"); 133 | wb.Headers.Add("If-None-Match", "53675C2E11C46B5C2AE17B5CC79E4D7F"); 134 | 135 | wb.Headers.Add("If-Modified-Since", "Mon, 15 Aug 2016 10:11:21 GMT"); 136 | wb.Headers.Add("Upgrade-Insecure-Requests", "1"); 137 | 138 | wb.Headers.Add("Host", "image.xinli001.com"); 139 | wb.Headers.Add("Connection", "keep-alive"); 140 | wb.Headers.Add("User-Agent", "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.75 Mobile Safari/537.36"); 141 | wb.Headers.Add("Referer", "http://fm.xinli001.com/"); 142 | wb.DownloadFile(Url, DirectoryPath); 143 | } 144 | } 145 | //}); 146 | } 147 | } 148 | } 149 | -------------------------------------------------------------------------------- /AduMusic/AduMusic/AduMusic.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {567C5328-B5ED-48B6-88EC-AC91FF5C924D} 8 | WinExe 9 | Properties 10 | AduMusic 11 | AduMusic 12 | v4.5 13 | 512 14 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 15 | 4 16 | 17 | 18 | AnyCPU 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | AnyCPU 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | 36 | 37 | 128.ico 38 | 39 | 40 | 41 | False 42 | bin\DLLs\3DTools.dll 43 | 44 | 45 | False 46 | bin\Debug\Newtonsoft.Json.dll 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 4.0 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | MSBuild:Compile 67 | Designer 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | MiniWindow.xaml 76 | 77 | 78 | Carousel2DView.xaml 79 | 80 | 81 | ImageItem.xaml 82 | 83 | 84 | 85 | UserLogin.xaml 86 | 87 | 88 | Home.xaml 89 | 90 | 91 | MusicList.xaml 92 | 93 | 94 | MSBuild:Compile 95 | Designer 96 | 97 | 98 | App.xaml 99 | Code 100 | 101 | 102 | MainWindow.xaml 103 | Code 104 | 105 | 106 | Designer 107 | MSBuild:Compile 108 | 109 | 110 | MSBuild:Compile 111 | Designer 112 | 113 | 114 | MSBuild:Compile 115 | Designer 116 | 117 | 118 | MSBuild:Compile 119 | Designer 120 | 121 | 122 | Designer 123 | MSBuild:Compile 124 | 125 | 126 | MSBuild:Compile 127 | Designer 128 | 129 | 130 | MSBuild:Compile 131 | Designer 132 | 133 | 134 | MSBuild:Compile 135 | Designer 136 | 137 | 138 | MSBuild:Compile 139 | Designer 140 | 141 | 142 | Designer 143 | MSBuild:Compile 144 | 145 | 146 | MSBuild:Compile 147 | Designer 148 | 149 | 150 | MSBuild:Compile 151 | Designer 152 | 153 | 154 | Designer 155 | MSBuild:Compile 156 | 157 | 158 | MSBuild:Compile 159 | Designer 160 | 161 | 162 | MSBuild:Compile 163 | Designer 164 | 165 | 166 | MSBuild:Compile 167 | Designer 168 | 169 | 170 | MSBuild:Compile 171 | Designer 172 | 173 | 174 | MSBuild:Compile 175 | Designer 176 | 177 | 178 | MSBuild:Compile 179 | Designer 180 | 181 | 182 | MSBuild:Compile 183 | Designer 184 | 185 | 186 | MSBuild:Compile 187 | Designer 188 | 189 | 190 | MSBuild:Compile 191 | Designer 192 | 193 | 194 | Designer 195 | MSBuild:Compile 196 | 197 | 198 | Designer 199 | MSBuild:Compile 200 | 201 | 202 | Designer 203 | MSBuild:Compile 204 | 205 | 206 | Designer 207 | MSBuild:Compile 208 | 209 | 210 | 211 | 212 | Code 213 | 214 | 215 | True 216 | True 217 | Resources.resx 218 | 219 | 220 | True 221 | Settings.settings 222 | True 223 | 224 | 225 | ResXFileCodeGenerator 226 | Resources.Designer.cs 227 | 228 | 229 | 230 | SettingsSingleFileGenerator 231 | Settings.Designer.cs 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 263 | -------------------------------------------------------------------------------- /AduMusic/AduMusic/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /AduMusic/AduMusic/App.xaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /AduMusic/AduMusic/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | using System.Windows.Threading; 9 | 10 | namespace AduMusic 11 | { 12 | /// 13 | /// App.xaml 的交互逻辑 14 | /// 15 | public partial class App : Application 16 | { 17 | public static Dispatcher DispatcherHelper; 18 | public static MainWindow APP; 19 | protected override void OnStartup(StartupEventArgs e) 20 | { 21 | MainWindow = APP; 22 | APP = new MainWindow(); 23 | DispatcherHelper = APP.Dispatcher; 24 | //APP.Show(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /AduMusic/AduMusic/Common/AsynchUtils.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading; 6 | using System.Threading.Tasks; 7 | using System.Windows.Threading; 8 | 9 | namespace AduMusic.Common 10 | { 11 | public class AsynchUtils 12 | { 13 | public delegate void AsynchWorkDelegate(); 14 | public delegate void AsynchWorkCompleteDelegate(object obj); 15 | 16 | private const int ThreadCount = 8; 17 | private static Thread[] WorkThreads; // 线程组 18 | private static LinkedList[] ThreadWorkerQueues; // 线程 19 | 20 | static AsynchUtils() 21 | { 22 | // 创建线程 23 | WorkThreads = new Thread[ThreadCount]; 24 | ThreadWorkerQueues = new LinkedList[ThreadCount]; 25 | 26 | // 创建链表(链表数与线程数相同) 27 | for (int i = 0; i < WorkThreads.Length; i++) 28 | { 29 | WorkThreads[i] = new Thread(new ParameterizedThreadStart(AsynchWorker)); 30 | WorkThreads[i].Name = "Worker Thread: " + i; 31 | ThreadWorkerQueues[i] = new LinkedList(); 32 | WorkThreads[i].Start(ThreadWorkerQueues[i]); 33 | } 34 | } 35 | 36 | public static void Dispose() 37 | { 38 | try 39 | { 40 | if (WorkThreads != null && WorkThreads.Length > 0) 41 | { 42 | for (int i = 0; i < WorkThreads.Length; i++) 43 | { 44 | if (WorkThreads[i] != null) 45 | WorkThreads[i].Abort(); 46 | } 47 | 48 | WorkThreads = null; 49 | ThreadWorkerQueues = null; 50 | } 51 | } 52 | catch { } 53 | } 54 | 55 | // 线程从链表获取需要执行的事件或方法并执行处理 56 | internal static void AsynchWorker(object oLinkedList) 57 | { 58 | var workQueue = (LinkedList)oLinkedList; 59 | while (true) 60 | { 61 | try 62 | { 63 | AsynchWorkDelegate delegateToExecute = null; 64 | Monitor.Enter(workQueue); 65 | { 66 | if (workQueue.Count == 0) 67 | Monitor.Wait(workQueue); 68 | delegateToExecute = workQueue.First.Value; 69 | workQueue.RemoveFirst(); 70 | } 71 | Monitor.Exit(workQueue); 72 | 73 | Thread.Sleep(10); 74 | 75 | if (delegateToExecute != null) 76 | delegateToExecute(); 77 | } 78 | catch 79 | { 80 | break; 81 | } 82 | } 83 | } 84 | 85 | private static void AddToWorkQueue(AsynchWorkDelegate work) 86 | { 87 | try 88 | { 89 | int min = int.MaxValue; 90 | LinkedList minQueue = null; 91 | 92 | // 获取所有链表中,挂载需要执行方法最少的链表和线程 93 | for (int i = 0; i < ThreadWorkerQueues.Length; i++) 94 | { 95 | if (min > ThreadWorkerQueues[i].Count) 96 | { 97 | min = ThreadWorkerQueues[i].Count; 98 | minQueue = ThreadWorkerQueues[i]; 99 | } 100 | } 101 | 102 | // 挂载方法或事件 103 | if (work != null) 104 | { 105 | Monitor.Enter(minQueue); 106 | { 107 | minQueue.AddLast(work); 108 | Monitor.Pulse(minQueue); 109 | } 110 | Monitor.Exit(minQueue); 111 | } 112 | } 113 | catch { } 114 | } 115 | 116 | public static void AsynchExecuteFunc(Dispatcher oDispatcher, AsynchWorkDelegate oEvent) 117 | { 118 | AddToWorkQueue(delegate () 119 | { 120 | if (oDispatcher != null && oEvent != null) 121 | oDispatcher.BeginInvoke(DispatcherPriority.SystemIdle, oEvent); 122 | }); 123 | } 124 | 125 | public static void AsynchSleepExecuteFunc(Dispatcher oDispatcher, AsynchWorkDelegate oEvent, double dDelayDuration = 0.3) 126 | { 127 | AddToWorkQueue(delegate () 128 | { 129 | Thread.Sleep(TimeSpan.FromSeconds(dDelayDuration)); 130 | 131 | if (oDispatcher != null && oEvent != null) 132 | oDispatcher.BeginInvoke(DispatcherPriority.SystemIdle, oEvent); 133 | }); 134 | } 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /AduMusic/AduMusic/Common/CvUtils.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Security.Cryptography; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | using System.Windows.Media; 9 | using System.Windows.Media.Animation; 10 | 11 | namespace AduMusic.Common 12 | { 13 | public class CvUtils 14 | { 15 | public static Random GetRandomSeed() 16 | { 17 | byte[] bytes = new byte[4]; 18 | RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider(); 19 | rng.GetBytes(bytes); 20 | return new Random(BitConverter.ToInt32(bytes, 0)); 21 | } 22 | 23 | public static bool IsImageType(string file) 24 | { 25 | //格式为jpg、png和bmp 26 | return file.ToLower().EndsWith(".jpg") || 27 | file.ToLower().EndsWith(".jpeg") || 28 | file.ToLower().EndsWith(".png") || 29 | file.ToLower().EndsWith(".bmp") || 30 | file.ToLower().EndsWith(".gif") || 31 | file.ToLower().EndsWith(".tiff"); 32 | } 33 | 34 | public static double ConvertToRads(double dDegree) 35 | { 36 | return dDegree * Math.PI / 180.0; 37 | } 38 | 39 | public static SolidColorBrush Convert16ToSolidColor(string value) 40 | { 41 | string val = value.ToString(); 42 | val = val.Replace("#", ""); 43 | byte a = Convert.ToByte("ff", 16); 44 | byte pos = 0; 45 | if (val.Length == 8) 46 | { 47 | a = Convert.ToByte(val.Substring(pos, 2), 16); 48 | pos = 2; 49 | } 50 | byte r = Convert.ToByte(val.Substring(pos, 2), 16); 51 | pos += 2; 52 | byte g = Convert.ToByte(val.Substring(pos, 2), 16); 53 | pos += 2; 54 | byte b = Convert.ToByte(val.Substring(pos, 2), 16); 55 | Color col = Color.FromArgb(a, r, g, b); 56 | return new SolidColorBrush(col); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /AduMusic/AduMusic/Common/FolderHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace AduMusic.Common 9 | { 10 | public class FolderHelper 11 | { 12 | #region 》获取文件夹下所有文件 13 | 14 | /// 15 | /// 获取文件夹下所有指定类型文件 16 | /// 17 | /// 文件夹路径 18 | /// 文件类型 19 | /// 是否递归获取子文件夹下文件, 默认为True 20 | /// 21 | public static List GetAllFileFullName(string sPath, bool IsRecursive = true) 22 | { 23 | List ltFiles = new List(); 24 | 25 | FolderHelper oFolderOperation = new FolderHelper(sPath); 26 | oFolderOperation.GetAllFiles(IsRecursive); 27 | for (int i = 0; i < oFolderOperation.listAllFiles.Count; i++) 28 | { 29 | if (CvUtils.IsImageType(oFolderOperation.listAllFiles[i])) 30 | ltFiles.Add(oFolderOperation.listAllFiles[i]); 31 | } 32 | return ltFiles; 33 | } 34 | 35 | #endregion 36 | 37 | #region 》获取文件夹下所有文件夹、子文件夹 38 | /// 39 | /// 获取文件夹下所有文件夹、子文件夹 40 | /// 41 | /// 文件夹路径 42 | /// 文件夹及子文件夹下所有文件 43 | public static List GetAllFolder(string sPath, bool IsRecursive = true) 44 | { 45 | FolderHelper oFolderOperation = new FolderHelper(sPath); 46 | oFolderOperation.GetAllFiles(IsRecursive); 47 | return oFolderOperation.listAllDirs; 48 | } 49 | #endregion 50 | 51 | 52 | 53 | #region 》Folder Operation 54 | 55 | /// 56 | /// 当前文件夹 57 | /// 58 | private string FolderPath; 59 | 60 | public FolderHelper(string sFolderPath) 61 | { 62 | this.FolderPath = sFolderPath; 63 | } 64 | 65 | /// 66 | /// 文件夹、子文件夹下所有文件列表 67 | /// 68 | private List listAllFiles = new List(); 69 | /// 70 | /// 文件夹、文件夹下所有子文件夹列表 71 | /// 72 | private List listAllDirs = new List(); 73 | 74 | /// 75 | /// 遍历获取所有文件、所有文件夹(包含子文件夹)列表 76 | /// 77 | public void GetAllFiles(bool IsRecursive = true) 78 | { 79 | if (Directory.Exists(this.FolderPath)) 80 | { 81 | this.GetAllChildDir(this.FolderPath, IsRecursive); //获取所有子文件夹 82 | if (IsRecursive) 83 | this.listAllDirs.Add(this.FolderPath); //添加跟节点文件夹 84 | } 85 | } 86 | 87 | /// 88 | /// 遍历文件夹下所有子文件夹 89 | /// 90 | /// 文件夹路径 91 | private void GetAllChildDir(string fatherPath, bool IsRecursive) 92 | { 93 | DirectoryInfo dir = new DirectoryInfo(fatherPath); 94 | FileInfo[] fis = dir.GetFiles(); 95 | if (fis.Length > 0) 96 | { 97 | for (int j = 0; j < fis.Length; j++) 98 | this.listAllFiles.Add(fis[j].FullName); 99 | } 100 | 101 | try 102 | { 103 | DirectoryInfo[] dirSons = dir.GetDirectories(); 104 | for (int i = 0; i < dirSons.Length; i++) 105 | { 106 | listAllDirs.Add(dirSons[i].FullName); 107 | if (IsRecursive) 108 | GetAllChildDir(dirSons[i].FullName, IsRecursive); //递归 109 | } 110 | } 111 | catch (Exception) 112 | { } 113 | } 114 | 115 | #endregion 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /AduMusic/AduMusic/Controls/ImageRadioButton.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | using System.Windows.Controls; 7 | using System.Windows.Media; 8 | 9 | namespace AduMusic.Controls 10 | { 11 | public class ImageRadioButton:RadioButton 12 | { 13 | public Geometry Image 14 | { 15 | get { return (Geometry)GetValue(ImageProperty); } 16 | set { SetValue(ImageProperty, value); } 17 | } 18 | 19 | public static readonly DependencyProperty ImageProperty = 20 | DependencyProperty.Register("Image", typeof(Geometry), typeof(ImageRadioButton)); 21 | 22 | 23 | 24 | public double ImageWidth 25 | { 26 | get { return (double)GetValue(ImageWidthProperty); } 27 | set { SetValue(ImageWidthProperty, value); } 28 | } 29 | 30 | public static readonly DependencyProperty ImageWidthProperty = 31 | DependencyProperty.Register("ImageWidth", typeof(double), typeof(ImageRadioButton),new PropertyMetadata(20.0)); 32 | 33 | public double ImageHeight 34 | { 35 | get { return (double)GetValue(ImageHeightProperty); } 36 | set { SetValue(ImageHeightProperty, value); } 37 | } 38 | 39 | public static readonly DependencyProperty ImageHeightProperty = 40 | DependencyProperty.Register("ImageHeight", typeof(double), typeof(ImageRadioButton),new PropertyMetadata(20.0)); 41 | 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /AduMusic/AduMusic/Fonts/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aduskin/AduMusic/91e4060ab291151ba47d18049063f6612f2dab23/AduMusic/AduMusic/Fonts/iconfont.ttf -------------------------------------------------------------------------------- /AduMusic/AduMusic/Images/Background/Sys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aduskin/AduMusic/91e4060ab291151ba47d18049063f6612f2dab23/AduMusic/AduMusic/Images/Background/Sys.png -------------------------------------------------------------------------------- /AduMusic/AduMusic/Images/Background/f3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aduskin/AduMusic/91e4060ab291151ba47d18049063f6612f2dab23/AduMusic/AduMusic/Images/Background/f3.jpg -------------------------------------------------------------------------------- /AduMusic/AduMusic/Images/ICON/128.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aduskin/AduMusic/91e4060ab291151ba47d18049063f6612f2dab23/AduMusic/AduMusic/Images/ICON/128.ico -------------------------------------------------------------------------------- /AduMusic/AduMusic/Images/ICON/48.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aduskin/AduMusic/91e4060ab291151ba47d18049063f6612f2dab23/AduMusic/AduMusic/Images/ICON/48.ico -------------------------------------------------------------------------------- /AduMusic/AduMusic/Images/Nor/Cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aduskin/AduMusic/91e4060ab291151ba47d18049063f6612f2dab23/AduMusic/AduMusic/Images/Nor/Cover.png -------------------------------------------------------------------------------- /AduMusic/AduMusic/Images/Nor/NorHeader.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aduskin/AduMusic/91e4060ab291151ba47d18049063f6612f2dab23/AduMusic/AduMusic/Images/Nor/NorHeader.jpg -------------------------------------------------------------------------------- /AduMusic/AduMusic/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Effects; 13 | using System.Windows.Media.Imaging; 14 | using System.Windows.Navigation; 15 | using System.Windows.Shapes; 16 | 17 | namespace AduMusic 18 | { 19 | /// 20 | /// MainWindow.xaml 的交互逻辑 21 | /// 22 | public partial class MainWindow : Window 23 | { 24 | public MainWindow() 25 | { 26 | InitializeComponent(); 27 | } 28 | 29 | private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) 30 | { 31 | this.DragMove(); 32 | } 33 | 34 | private void Close_Click(object sender, RoutedEventArgs e) 35 | { 36 | //Application.Current.Shutdown(); 37 | Environment.Exit(0); 38 | } 39 | 40 | private void Mini_Click(object sender, RoutedEventArgs e) 41 | { 42 | MiniWindow mw = new MiniWindow(this); 43 | mw.Show(); 44 | this.Hide(); 45 | 46 | } 47 | 48 | private void Max_Click(object sender, RoutedEventArgs e) 49 | { 50 | WindowStateChange(); 51 | } 52 | private void WindowStateChange() 53 | { 54 | if (this.WindowState == WindowState.Maximized) 55 | { 56 | this.WindowState = WindowState.Normal; 57 | } 58 | else 59 | { 60 | this.WindowState = WindowState.Maximized; 61 | } 62 | } 63 | private void Window_StateChanged(object sender, EventArgs e) 64 | { 65 | DropShadowEffect de = null; 66 | if (this.WindowState == WindowState.Normal) 67 | { 68 | de = new DropShadowEffect(); 69 | this.BorderThickness = new Thickness(20); 70 | de.BlurRadius = 20; 71 | de.Opacity = .15; 72 | de.ShadowDepth = 0; 73 | this.Effect = de; 74 | } 75 | else 76 | { 77 | this.BorderThickness = new Thickness(5); 78 | this.Effect = null; 79 | } 80 | } 81 | 82 | private void Min_Click(object sender, RoutedEventArgs e) 83 | { 84 | this.WindowState = WindowState.Minimized; 85 | } 86 | 87 | private void ImageRadioButton_Click(object sender, RoutedEventArgs e) 88 | { 89 | RadioButton radio = (RadioButton)sender; 90 | mainFrame.Navigate(new Uri(radio.Tag.ToString(), UriKind.Relative)); 91 | } 92 | 93 | private void Button_Click(object sender, RoutedEventArgs e) 94 | { 95 | UserLogin ul = new UserLogin(); 96 | ul.Show(); 97 | } 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /AduMusic/AduMusic/MiniWindow.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 35 | 36 | 37 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /AduMusic/AduMusic/UserLogin.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Shapes; 14 | 15 | namespace AduMusic 16 | { 17 | /// 18 | /// UserLogin.xaml 的交互逻辑 19 | /// 20 | public partial class UserLogin : Window 21 | { 22 | public UserLogin() 23 | { 24 | InitializeComponent(); 25 | } 26 | 27 | private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) 28 | { 29 | this.DragMove(); 30 | } 31 | 32 | private void btnClose_Click(object sender, RoutedEventArgs e) 33 | { 34 | this.Close(); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /AduMusic/AduMusic/Views/Home.xaml: -------------------------------------------------------------------------------- 1 |  11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |