diff --git a/MikuWeather_CS/App.config b/MikuWeather_CS/App.config index 079bcdf..564d77b 100644 --- a/MikuWeather_CS/App.config +++ b/MikuWeather_CS/App.config @@ -1,10 +1,23 @@ - + - - - + + + - - + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MikuWeather_CS/DataQuery.cs b/MikuWeather_CS/DataQuery.cs index 99b3731..0c6cb08 100644 --- a/MikuWeather_CS/DataQuery.cs +++ b/MikuWeather_CS/DataQuery.cs @@ -1,77 +1,101 @@ -using System; +using Newtonsoft.Json.Linq; +using System; using System.Collections.Generic; using System.Configuration; using System.IO; using System.Net; using System.Text; -using Newtonsoft.Json.Linq; -namespace MikuWeather -{ - internal static class DataQuery - { - public static Dictionary UpdateData_Baidu(string city) - { - Dictionary resultDict = new Dictionary(); +namespace MikuWeather { + + internal static class DataQuery { + + public static Dictionary UpdateData_Baidu(string city) { + var resultDict = new Dictionary(); const string url = "http://api.map.baidu.com/telematics/v3/weather?location="; var key = ConfigurationManager.AppSettings["apikey_baidu"]; var requestUrl = url + city + "&output=json&ak=" + key; - var request = (HttpWebRequest) WebRequest.Create(requestUrl); + var request = (HttpWebRequest)WebRequest.Create(requestUrl); request.Method = "GET"; string result; - try - { - var response = (HttpWebResponse) request.GetResponse(); + try { + var response = (HttpWebResponse)request.GetResponse(); using (var reader = new StreamReader(response.GetResponseStream() ?? throw new InvalidOperationException(), - Encoding.UTF8)) - { + Encoding.UTF8)) { result = reader.ReadToEnd(); } } - catch (Exception exception) - { - resultDict.Add("Exception", exception.Message); + catch (Exception exception) { + resultDict.Add("exception", exception.Message); return resultDict; } var resultJo = JObject.Parse(result); - var status = (string) resultJo.SelectToken("error"); - if (status != "0") - { - resultDict.Add("Exception", "error code"); + var status = (string)resultJo.SelectToken("error"); + if (status != "0") { + resultDict.Add("exception", "error code"); return resultDict; } - var pm25Str = resultJo.SelectToken("pm25").ToString(); var resultToken = resultJo.SelectToken("results")[0]; + var pm25 = resultToken.SelectToken("pm25").ToString(); + resultDict.Add("pm25", pm25); + var weatherToken = resultToken.SelectToken("weather_data"); + + var todayToken = weatherToken[0]; + var todayTemp = todayToken.SelectToken("temperature").ToString(); + var todayTempFormat = FormatTemp(todayTemp); + var todayWeather = todayToken.SelectToken("weather").ToString(); + var todayDayPicUrl = todayToken.SelectToken("dayPictureUrl").ToString(); + var todayNightPicUrl = todayToken.SelectToken("nightPictureUrl").ToString(); + resultDict.Add("today temp", todayTempFormat); + resultDict.Add("today weather", todayWeather); + resultDict.Add("today day pic url", todayDayPicUrl); + resultDict.Add("today night pic url", todayNightPicUrl); + + var tomorrowToken = weatherToken[1]; + var tomorrowTemp = tomorrowToken.SelectToken("temperature").ToString(); + var tomorrowTempFormat = FormatTemp(tomorrowTemp); + var tomorrowWeather = tomorrowToken.SelectToken("weather").ToString(); + var tomorrowDayPicUrl = tomorrowToken.SelectToken("dayPictureUrl").ToString(); + var tomorrowNightPicUrl = tomorrowToken.SelectToken("nightPictureUrl").ToString(); + resultDict.Add("tomorrow temp", tomorrowTempFormat); + resultDict.Add("tomorrow weather", tomorrowWeather); ; + resultDict.Add("tomorrow day pic url", tomorrowDayPicUrl); + resultDict.Add("tomorrow night pic url", tomorrowNightPicUrl); + return resultDict; } - public static string GetLocation() - { + private static string FormatTemp(string tempStr) { + tempStr = tempStr.Replace("℃", ""); + var tempSplit = tempStr.Split('~'); + var tempLow = tempSplit[1]; + var tempHigh = tempSplit[0]; + var result = tempLow + " ~ " + tempHigh + "℃"; + return result; + } + + public static string GetLocation() { const string url = "http://api.map.baidu.com/location/ip?ak="; var key = ConfigurationManager.AppSettings["apikey_baidu"]; var requestUrl = url + key; var request = (HttpWebRequest)WebRequest.Create(requestUrl); request.Method = "GET"; string result; - try - { + try { var response = (HttpWebResponse)request.GetResponse(); - using (var reader = new StreamReader(response.GetResponseStream() ?? throw new InvalidOperationException(), Encoding.UTF8)) - { + using (var reader = new StreamReader(response.GetResponseStream() ?? throw new InvalidOperationException(), Encoding.UTF8)) { result = reader.ReadToEnd(); } } - catch (Exception) - { + catch (Exception) { return "Exception"; } var resultJo = JObject.Parse(result); var status = (string)resultJo.SelectToken("status"); - if (status != "0") - { + if (status != "0") { return "status code ≠ 0"; } var contentToken = resultJo.SelectToken("content").SelectToken("address_detail"); @@ -80,4 +104,4 @@ public static string GetLocation() return cityName; } } -} +} \ No newline at end of file diff --git a/MikuWeather_CS/Form1.Designer.cs b/MikuWeather_CS/Form1.Designer.cs index daae2ad..9fe4bb7 100644 --- a/MikuWeather_CS/Form1.Designer.cs +++ b/MikuWeather_CS/Form1.Designer.cs @@ -1,11 +1,14 @@ -namespace MikuWeather +using System.ComponentModel; +using System.Windows.Forms; + +namespace MikuWeather { partial class Form1 { /// /// Required designer variable. /// - private System.ComponentModel.IContainer components = null; + private IContainer components = null; /// /// Clean up any resources being used. @@ -30,59 +33,69 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); - this.pictureBox1 = new System.Windows.Forms.PictureBox(); + this.picBox = new System.Windows.Forms.PictureBox(); this.cmMenu = new System.Windows.Forms.ContextMenuStrip(this.components); this.cmWebsite = new System.Windows.Forms.ToolStripMenuItem(); + this.cmUpdate = new System.Windows.Forms.ToolStripMenuItem(); this.cmExit = new System.Windows.Forms.ToolStripMenuItem(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.picBox)).BeginInit(); this.cmMenu.SuspendLayout(); this.SuspendLayout(); // - // pictureBox1 + // picBox // - this.pictureBox1.ContextMenuStrip = this.cmMenu; - this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image"))); - this.pictureBox1.Location = new System.Drawing.Point(0, 0); - this.pictureBox1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(140, 140); - this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; - this.pictureBox1.TabIndex = 0; - this.pictureBox1.TabStop = false; - this.pictureBox1.MouseEnter += new System.EventHandler(this.Form1_MouseHover); - this.pictureBox1.MouseLeave += new System.EventHandler(this.Form1_MouseLeave); - this.pictureBox1.MouseHover += new System.EventHandler(this.Form1_MouseHover); + this.picBox.ContextMenuStrip = this.cmMenu; + this.picBox.Image = ((System.Drawing.Image)(resources.GetObject("picBox.Image"))); + this.picBox.Location = new System.Drawing.Point(0, 0); + this.picBox.Margin = new System.Windows.Forms.Padding(4); + this.picBox.Name = "picBox"; + this.picBox.Size = new System.Drawing.Size(280, 280); + this.picBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; + this.picBox.TabIndex = 0; + this.picBox.TabStop = false; + this.picBox.MouseEnter += new System.EventHandler(this.Form1_MouseHover); + this.picBox.MouseLeave += new System.EventHandler(this.Form1_MouseLeave); + this.picBox.MouseHover += new System.EventHandler(this.Form1_MouseHover); // // cmMenu // + this.cmMenu.ImageScalingSize = new System.Drawing.Size(32, 32); this.cmMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.cmWebsite, + this.cmUpdate, this.cmExit}); this.cmMenu.Name = "cmMenu"; - this.cmMenu.Size = new System.Drawing.Size(181, 70); + this.cmMenu.Size = new System.Drawing.Size(263, 118); // // cmWebsite // this.cmWebsite.Name = "cmWebsite"; - this.cmWebsite.Size = new System.Drawing.Size(180, 22); + this.cmWebsite.Size = new System.Drawing.Size(262, 38); this.cmWebsite.Text = "访问Github仓库"; this.cmWebsite.Click += new System.EventHandler(this.CmWebsite_Click); // + // cmUpdate + // + this.cmUpdate.Name = "cmUpdate"; + this.cmUpdate.Size = new System.Drawing.Size(262, 38); + this.cmUpdate.Text = "Update"; + this.cmUpdate.Click += new System.EventHandler(this.CmUpdate_Click); + // // cmExit // this.cmExit.Name = "cmExit"; - this.cmExit.Size = new System.Drawing.Size(180, 22); + this.cmExit.Size = new System.Drawing.Size(262, 38); this.cmExit.Text = "退出"; this.cmExit.Click += new System.EventHandler(this.CmExit_Click); // // Form1 // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(140, 140); - this.Controls.Add(this.pictureBox1); + this.ClientSize = new System.Drawing.Size(280, 280); + this.Controls.Add(this.picBox); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; - this.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3); + this.Margin = new System.Windows.Forms.Padding(4, 6, 4, 6); this.Name = "Form1"; this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; this.Text = "Form1"; @@ -90,7 +103,7 @@ private void InitializeComponent() { this.Load += new System.EventHandler(this.Form1_Load); this.MouseLeave += new System.EventHandler(this.Form1_MouseLeave); this.MouseHover += new System.EventHandler(this.Form1_MouseHover); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.picBox)).EndInit(); this.cmMenu.ResumeLayout(false); this.ResumeLayout(false); @@ -98,9 +111,10 @@ private void InitializeComponent() { #endregion - private System.Windows.Forms.PictureBox pictureBox1; - private System.Windows.Forms.ContextMenuStrip cmMenu; - private System.Windows.Forms.ToolStripMenuItem cmWebsite; - private System.Windows.Forms.ToolStripMenuItem cmExit; + private PictureBox picBox; + private ContextMenuStrip cmMenu; + private ToolStripMenuItem cmWebsite; + private ToolStripMenuItem cmExit; + private ToolStripMenuItem cmUpdate; } } \ No newline at end of file diff --git a/MikuWeather_CS/Form1.cs b/MikuWeather_CS/Form1.cs index 2e7809b..80d7ab1 100644 --- a/MikuWeather_CS/Form1.cs +++ b/MikuWeather_CS/Form1.cs @@ -3,20 +3,20 @@ using System.Drawing; using System.Windows.Forms; -namespace MikuWeather -{ - public partial class Form1 : Form - { +namespace MikuWeather { + + public partial class Form1 : Form { + // ReSharper disable once FieldCanBeMadeReadOnly.Local private readonly FormShow _frmShow = new FormShow(); - - public Form1() - { + + private string _city; + + public Form1() { InitializeComponent(); } - private void Form1_Load(object sender, EventArgs e) - { + private void Form1_Load(object sender, EventArgs e) { BackColor = Color.FloralWhite; TransparencyKey = BackColor; @@ -24,14 +24,14 @@ private void Form1_Load(object sender, EventArgs e) SetBounds(Screen.PrimaryScreen.WorkingArea.Width - 272, intScreenY - Size.Height + 13, Size.Width, Size.Height); - var city = DataQuery.GetLocation(); - MessageBox.Show(city); + _city = DataQuery.GetLocation(); + Update(); } private void Form1_MouseHover(object sender, EventArgs e) { - _frmShow.SetBounds(Location.X - _frmShow.Width / 2 + Width / 2, - Location.Y - _frmShow.Height, - _frmShow.Width, + _frmShow.SetBounds(Location.X - _frmShow.Width / 2 + Width / 2 - 15, + Location.Y - _frmShow.Height, + _frmShow.Width, _frmShow.Height); _frmShow.Show(); } @@ -40,15 +40,25 @@ private void Form1_MouseLeave(object sender, EventArgs e) { _frmShow.Hide(); } - private void CmWebsite_Click(object sender, EventArgs e) - { + private void CmWebsite_Click(object sender, EventArgs e) { Process.Start("https://github.com/RainySummerLuo/MikuWeather_Windows"); } - private void CmExit_Click(object sender, EventArgs e) - { + private void CmExit_Click(object sender, EventArgs e) { Close(); Environment.Exit(0); } + + private void CmUpdate_Click(object sender, EventArgs e) { + Update(); + } + + private new void Update() { + var dict = DataQuery.UpdateData_Baidu(_city); + _frmShow.SetTemp(dict["today temp"], dict["tomorrow temp"]); + _frmShow.SetWeather(dict["today weather"], dict["tomorrow weather"]); + var bitmapPic = _frmShow.SetPic(dict["today day pic url"], dict["today night pic url"], dict["tomorrow day pic url"], dict["tomorrow night pic url"]); + picBox.Image = bitmapPic; + } } } \ No newline at end of file diff --git a/MikuWeather_CS/Form1.resx b/MikuWeather_CS/Form1.resx index 551dbeb..7448fd7 100644 --- a/MikuWeather_CS/Form1.resx +++ b/MikuWeather_CS/Form1.resx @@ -121,7 +121,7 @@ 17, 17 - + iVBORw0KGgoAAAANSUhEUgAAARsAAAD5CAYAAAAX1pEcAAAABGdBTUEAALGPC/xhBQAA/sRJREFUeF7s fQV8VEfX/gR3l2AhBgSX4haCBXd3d/dCKRR3t+CuBVpqL3V3V+qlpaVogULxnP95ZvdsZid3NxtCv6/f @@ -1215,6 +1215,6 @@ - 62 + 77 \ No newline at end of file diff --git a/MikuWeather_CS/FormShow.Designer.cs b/MikuWeather_CS/FormShow.Designer.cs index 3ae2ab6..1297c66 100644 --- a/MikuWeather_CS/FormShow.Designer.cs +++ b/MikuWeather_CS/FormShow.Designer.cs @@ -1,4 +1,5 @@ using System.ComponentModel; +using System.Windows.Forms; namespace MikuWeather { partial class FormShow { @@ -26,127 +27,127 @@ protected override void Dispose(bool disposing) { /// the contents of this method with the code editor. /// private void InitializeComponent() { - this.pictureBox1 = new System.Windows.Forms.PictureBox(); - this.pictureBox2 = new System.Windows.Forms.PictureBox(); - this.linkLabel1 = new System.Windows.Forms.LinkLabel(); - this.linkLabel3 = new System.Windows.Forms.LinkLabel(); - this.linkLabel2 = new System.Windows.Forms.LinkLabel(); - this.linkLabel4 = new System.Windows.Forms.LinkLabel(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); + this.picToday = new System.Windows.Forms.PictureBox(); + this.picTomorrow = new System.Windows.Forms.PictureBox(); + this.lnkTodayWeather = new System.Windows.Forms.LinkLabel(); + this.lnkTodayTemp = new System.Windows.Forms.LinkLabel(); + this.lnkTomorrowTemp = new System.Windows.Forms.LinkLabel(); + this.lnkTomorrowWeather = new System.Windows.Forms.LinkLabel(); + ((System.ComponentModel.ISupportInitialize)(this.picToday)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.picTomorrow)).BeginInit(); this.SuspendLayout(); // - // pictureBox1 + // picToday // - this.pictureBox1.BackColor = System.Drawing.Color.Transparent; - this.pictureBox1.Image = global::MikuWeather.Properties.Resources.晴1; - this.pictureBox1.Location = new System.Drawing.Point(18, 16); - this.pictureBox1.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1); - this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(144, 144); - this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; - this.pictureBox1.TabIndex = 0; - this.pictureBox1.TabStop = false; + this.picToday.BackColor = System.Drawing.Color.Transparent; + this.picToday.Image = global::MikuWeather.Properties.Resources.晴_日; + this.picToday.Location = new System.Drawing.Point(36, 32); + this.picToday.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); + this.picToday.Name = "picToday"; + this.picToday.Size = new System.Drawing.Size(288, 288); + this.picToday.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; + this.picToday.TabIndex = 0; + this.picToday.TabStop = false; // - // pictureBox2 + // picTomorrow // - this.pictureBox2.BackColor = System.Drawing.Color.Transparent; - this.pictureBox2.Image = global::MikuWeather.Properties.Resources.晴1; - this.pictureBox2.Location = new System.Drawing.Point(184, 16); - this.pictureBox2.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1); - this.pictureBox2.Name = "pictureBox2"; - this.pictureBox2.Size = new System.Drawing.Size(144, 144); - this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; - this.pictureBox2.TabIndex = 1; - this.pictureBox2.TabStop = false; + this.picTomorrow.BackColor = System.Drawing.Color.Transparent; + this.picTomorrow.Image = global::MikuWeather.Properties.Resources.晴_日; + this.picTomorrow.Location = new System.Drawing.Point(368, 32); + this.picTomorrow.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); + this.picTomorrow.Name = "picTomorrow"; + this.picTomorrow.Size = new System.Drawing.Size(288, 288); + this.picTomorrow.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; + this.picTomorrow.TabIndex = 1; + this.picTomorrow.TabStop = false; // - // linkLabel1 + // lnkTodayWeather // - this.linkLabel1.BackColor = System.Drawing.Color.Transparent; - this.linkLabel1.Font = new System.Drawing.Font("条幅黑体", 13.5F); - this.linkLabel1.ForeColor = System.Drawing.Color.MediumTurquoise; - this.linkLabel1.LinkArea = new System.Windows.Forms.LinkArea(0, 0); - this.linkLabel1.Location = new System.Drawing.Point(0, 150); - this.linkLabel1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.linkLabel1.Name = "linkLabel1"; - this.linkLabel1.Size = new System.Drawing.Size(174, 21); - this.linkLabel1.TabIndex = 2; - this.linkLabel1.Text = "无数据"; - this.linkLabel1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.lnkTodayWeather.BackColor = System.Drawing.Color.Transparent; + this.lnkTodayWeather.Font = new System.Drawing.Font("条幅黑体", 13.5F); + this.lnkTodayWeather.ForeColor = System.Drawing.Color.MediumTurquoise; + this.lnkTodayWeather.LinkArea = new System.Windows.Forms.LinkArea(0, 0); + this.lnkTodayWeather.Location = new System.Drawing.Point(0, 300); + this.lnkTodayWeather.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.lnkTodayWeather.Name = "lnkTodayWeather"; + this.lnkTodayWeather.Size = new System.Drawing.Size(348, 42); + this.lnkTodayWeather.TabIndex = 2; + this.lnkTodayWeather.Text = "无数据"; + this.lnkTodayWeather.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // linkLabel3 + // lnkTodayTemp // - this.linkLabel3.BackColor = System.Drawing.Color.Transparent; - this.linkLabel3.Font = new System.Drawing.Font("MF YaYuan (Noncommercial) Regul", 13F); - this.linkLabel3.ForeColor = System.Drawing.Color.LightGreen; - this.linkLabel3.LinkArea = new System.Windows.Forms.LinkArea(0, 0); - this.linkLabel3.Location = new System.Drawing.Point(0, 170); - this.linkLabel3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.linkLabel3.Name = "linkLabel3"; - this.linkLabel3.Size = new System.Drawing.Size(174, 24); - this.linkLabel3.TabIndex = 4; - this.linkLabel3.Text = "-- °C"; - this.linkLabel3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.lnkTodayTemp.BackColor = System.Drawing.Color.Transparent; + this.lnkTodayTemp.Font = new System.Drawing.Font("MF YaYuan (Noncommercial) Regul", 13F); + this.lnkTodayTemp.ForeColor = System.Drawing.Color.LightGreen; + this.lnkTodayTemp.LinkArea = new System.Windows.Forms.LinkArea(0, 0); + this.lnkTodayTemp.Location = new System.Drawing.Point(0, 340); + this.lnkTodayTemp.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.lnkTodayTemp.Name = "lnkTodayTemp"; + this.lnkTodayTemp.Size = new System.Drawing.Size(348, 48); + this.lnkTodayTemp.TabIndex = 4; + this.lnkTodayTemp.Text = "-- °C"; + this.lnkTodayTemp.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // linkLabel2 + // lnkTomorrowTemp // - this.linkLabel2.BackColor = System.Drawing.Color.Transparent; - this.linkLabel2.Font = new System.Drawing.Font("MF YaYuan (Noncommercial) Regul", 13F); - this.linkLabel2.ForeColor = System.Drawing.Color.LightGreen; - this.linkLabel2.LinkArea = new System.Windows.Forms.LinkArea(0, 0); - this.linkLabel2.Location = new System.Drawing.Point(175, 170); - this.linkLabel2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.linkLabel2.Name = "linkLabel2"; - this.linkLabel2.Size = new System.Drawing.Size(174, 24); - this.linkLabel2.TabIndex = 6; - this.linkLabel2.Text = "-- °C"; - this.linkLabel2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.lnkTomorrowTemp.BackColor = System.Drawing.Color.Transparent; + this.lnkTomorrowTemp.Font = new System.Drawing.Font("MF YaYuan (Noncommercial) Regul", 13F); + this.lnkTomorrowTemp.ForeColor = System.Drawing.Color.LightGreen; + this.lnkTomorrowTemp.LinkArea = new System.Windows.Forms.LinkArea(0, 0); + this.lnkTomorrowTemp.Location = new System.Drawing.Point(350, 340); + this.lnkTomorrowTemp.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.lnkTomorrowTemp.Name = "lnkTomorrowTemp"; + this.lnkTomorrowTemp.Size = new System.Drawing.Size(348, 48); + this.lnkTomorrowTemp.TabIndex = 6; + this.lnkTomorrowTemp.Text = "-- °C"; + this.lnkTomorrowTemp.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // linkLabel4 + // lnkTomorrowWeather // - this.linkLabel4.BackColor = System.Drawing.Color.Transparent; - this.linkLabel4.Font = new System.Drawing.Font("条幅黑体", 13.5F); - this.linkLabel4.ForeColor = System.Drawing.Color.MediumTurquoise; - this.linkLabel4.LinkArea = new System.Windows.Forms.LinkArea(0, 0); - this.linkLabel4.Location = new System.Drawing.Point(175, 150); - this.linkLabel4.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.linkLabel4.Name = "linkLabel4"; - this.linkLabel4.Size = new System.Drawing.Size(174, 21); - this.linkLabel4.TabIndex = 5; - this.linkLabel4.Text = "无数据"; - this.linkLabel4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.lnkTomorrowWeather.BackColor = System.Drawing.Color.Transparent; + this.lnkTomorrowWeather.Font = new System.Drawing.Font("条幅黑体", 13.5F); + this.lnkTomorrowWeather.ForeColor = System.Drawing.Color.MediumTurquoise; + this.lnkTomorrowWeather.LinkArea = new System.Windows.Forms.LinkArea(0, 0); + this.lnkTomorrowWeather.Location = new System.Drawing.Point(350, 300); + this.lnkTomorrowWeather.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.lnkTomorrowWeather.Name = "lnkTomorrowWeather"; + this.lnkTomorrowWeather.Size = new System.Drawing.Size(348, 42); + this.lnkTomorrowWeather.TabIndex = 5; + this.lnkTomorrowWeather.Text = "无数据"; + this.lnkTomorrowWeather.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // FormShow // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackgroundImage = global::MikuWeather.Properties.Resources.bg_wdt; this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; - this.ClientSize = new System.Drawing.Size(349, 195); - this.Controls.Add(this.linkLabel2); - this.Controls.Add(this.linkLabel4); - this.Controls.Add(this.linkLabel3); - this.Controls.Add(this.linkLabel1); - this.Controls.Add(this.pictureBox2); - this.Controls.Add(this.pictureBox1); + this.ClientSize = new System.Drawing.Size(698, 390); + this.Controls.Add(this.lnkTomorrowTemp); + this.Controls.Add(this.lnkTomorrowWeather); + this.Controls.Add(this.lnkTodayTemp); + this.Controls.Add(this.lnkTodayWeather); + this.Controls.Add(this.picTomorrow); + this.Controls.Add(this.picToday); this.DoubleBuffered = true; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; - this.Margin = new System.Windows.Forms.Padding(2); + this.Margin = new System.Windows.Forms.Padding(4); this.Name = "FormShow"; this.Text = "FormShow"; - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.picToday)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.picTomorrow)).EndInit(); this.ResumeLayout(false); } #endregion - private System.Windows.Forms.PictureBox pictureBox1; - private System.Windows.Forms.PictureBox pictureBox2; - private System.Windows.Forms.LinkLabel linkLabel1; - private System.Windows.Forms.LinkLabel linkLabel3; - private System.Windows.Forms.LinkLabel linkLabel2; - private System.Windows.Forms.LinkLabel linkLabel4; + private PictureBox picToday; + private PictureBox picTomorrow; + private LinkLabel lnkTodayWeather; + private LinkLabel lnkTodayTemp; + private LinkLabel lnkTomorrowTemp; + private LinkLabel lnkTomorrowWeather; } } \ No newline at end of file diff --git a/MikuWeather_CS/FormShow.cs b/MikuWeather_CS/FormShow.cs index 08a7653..1a104f8 100644 --- a/MikuWeather_CS/FormShow.cs +++ b/MikuWeather_CS/FormShow.cs @@ -1,9 +1,127 @@ -using System.Windows.Forms; +using MikuWeather.Properties; +using System; +using System.Drawing; +using System.Windows.Forms; namespace MikuWeather { + public partial class FormShow : Form { + public FormShow() { InitializeComponent(); } + + public void SetTemp(string todayTemp, string tomorrowTemp) { + lnkTodayTemp.Text = todayTemp; + lnkTomorrowTemp.Text = tomorrowTemp; + } + + public void SetWeather(string todayWeather, string tomorrowWeather) { + lnkTodayWeather.Text = todayWeather; + lnkTomorrowWeather.Text = tomorrowWeather; + } + + public Bitmap SetPic(string todayDayPicUrl, string todayNightPicUrl, string tomorrowDayPicUrl, string tomorrowNightPicUrl) { + bool isDay; + var hour = DateTime.Now.Hour; + string todayPicUrl; + string tomorrowPicUrl; + if (hour < 18 && hour >= 6) { + todayPicUrl = todayDayPicUrl; + tomorrowPicUrl = tomorrowDayPicUrl; + isDay = true; + } else { + todayPicUrl = todayNightPicUrl; + tomorrowPicUrl = tomorrowNightPicUrl; + isDay = false; + } + var todayPicUrlSplit = todayPicUrl.Split('/'); + var todayPicName = todayPicUrlSplit[todayPicUrlSplit.Length - 1]; + var tomorrowPicUrlSplit = tomorrowPicUrl.Split('/'); + var tomorrowPicName = tomorrowPicUrlSplit[tomorrowPicUrlSplit.Length - 1]; + var bitmapToday = SwitchPic(todayPicName, isDay); + picToday.Image = bitmapToday; + picTomorrow.Image = SwitchPic(tomorrowPicName, isDay); + return bitmapToday; + } + + private static Bitmap SwitchPic(string picName, bool isDay) { + if (isDay) { + switch (picName) { + case "qing.png": + return Resources.晴_日; + + case "duoyun.png": + return Resources.多云_日; + + case "xiaoyu.png": + case "zhenyu.png": + return Resources.雨_日; + + case "zhenxue.png": + case "xiaoxue.png": + case "zhongxue.png": + return Resources.雪_日; + + case "leizhenyu.png": + case "leizhenyubanyoubingbao.png": + return Resources.雷阵雨_日; + } + } else { + switch (picName) { + case "qing.png": + return Resources.晴_夜; + + case "duoyun.png": + return Resources.多云_夜; + + case "xiaoyu.png": + case "zhenyu.png": + return Resources.雨_夜; + + case "zhenxue.png": + case "xiaoxue.png": + case "zhongxue.png": + return Resources.雪_夜; + + case "leizhenyu.png": + case "leizhenyubanyoubingbao.png": + return Resources.雷阵雨_夜; + } + } + switch (picName) { + case "yin.png": + return Resources.阴; + + case "yinyu.png": + return Resources.阴雨; + + case "zhongyu.png": + return Resources.中雨; + + case "dayu.png": + case "baoyu.png": + case "dabaoyu.png": + case "tedabaoyu.png": + return Resources.大雨; + + case "daxue.png": + case "baoxue.png": + return Resources.暴雪; + + case "qiangshachenbao.png": + case "shachenbao.png": + case "wu.png": + case "mai.png": + case "fuchen.png": + case "yangsha.png": + return Resources.雾; + + case "dongyu.png": + case "yujiaxue.png": + return Resources.雨夹雪; + } + return null; + } } } \ No newline at end of file diff --git a/MikuWeather_CS/MikuWeather.csproj b/MikuWeather_CS/MikuWeather.csproj index 5a19d22..45bf689 100644 --- a/MikuWeather_CS/MikuWeather.csproj +++ b/MikuWeather_CS/MikuWeather.csproj @@ -11,13 +11,13 @@ v4.7.2 512 true - true + false AnyCPU true full - false + true bin\Debug\ DEBUG;TRACE prompt @@ -32,6 +32,12 @@ prompt 4 + + icon.ico + + + MikuWeather.Program + packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll @@ -40,6 +46,7 @@ + @@ -80,6 +87,7 @@ True Resources.resx + True @@ -96,6 +104,7 @@ + diff --git a/MikuWeather_CS/Program.cs b/MikuWeather_CS/Program.cs index cc168af..ac69136 100644 --- a/MikuWeather_CS/Program.cs +++ b/MikuWeather_CS/Program.cs @@ -1,19 +1,15 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using System.Windows.Forms; -namespace MikuWeather -{ - static class Program - { +namespace MikuWeather { + + internal static class Program { + /// /// The main entry point for the application. /// [STAThread] - static void Main() - { + private static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); diff --git a/MikuWeather_CS/Properties/AssemblyInfo.cs b/MikuWeather_CS/Properties/AssemblyInfo.cs index 6e53f48..a64bb9d 100644 --- a/MikuWeather_CS/Properties/AssemblyInfo.cs +++ b/MikuWeather_CS/Properties/AssemblyInfo.cs @@ -1,16 +1,16 @@ -using System.Reflection; -using System.Runtime.CompilerServices; +using System.Resources; +using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("MikuWeather")] +[assembly: AssemblyTitle("初音天气")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("MikuWeather")] -[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyProduct("MikuWeather Windows")] +[assembly: AssemblyCopyright("Copyright RainySummer © 2019")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -32,5 +32,6 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file +[assembly: AssemblyVersion("3.9.*")] +[assembly: AssemblyFileVersion("3.9")] +[assembly: NeutralResourcesLanguage("zh")] diff --git a/MikuWeather_CS/Properties/Resources.Designer.cs b/MikuWeather_CS/Properties/Resources.Designer.cs index 29f9951..02020d6 100644 --- a/MikuWeather_CS/Properties/Resources.Designer.cs +++ b/MikuWeather_CS/Properties/Resources.Designer.cs @@ -8,10 +8,16 @@ // //------------------------------------------------------------------------------ +using System.CodeDom.Compiler; +using System.ComponentModel; +using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; +using System.Drawing; +using System.Globalization; +using System.Resources; +using System.Runtime.CompilerServices; + namespace MikuWeather.Properties { - using System; - - /// /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -19,27 +25,27 @@ namespace MikuWeather.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [DebuggerNonUserCode()] + [CompilerGenerated()] internal class Resources { - private static global::System.Resources.ResourceManager resourceMan; + private static ResourceManager resourceMan; - private static global::System.Globalization.CultureInfo resourceCulture; + private static CultureInfo resourceCulture; - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Resources() { } /// /// Returns the cached ResourceManager instance used by this class. /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { + [EditorBrowsable(EditorBrowsableState.Advanced)] + internal static ResourceManager ResourceManager { get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MikuWeather.Properties.Resources", typeof(Resources).Assembly); + if (ReferenceEquals(resourceMan, null)) { + ResourceManager temp = new ResourceManager("MikuWeather.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; @@ -50,8 +56,8 @@ internal Resources() { /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { + [EditorBrowsable(EditorBrowsableState.Advanced)] + internal static CultureInfo Culture { get { return resourceCulture; } @@ -63,210 +69,190 @@ internal Resources() { /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap bg_wdt { + internal static Bitmap bg_wdt { get { object obj = ResourceManager.GetObject("bg_wdt", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap 中雨1 { - get { - object obj = ResourceManager.GetObject("中雨1", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap 夜多云 { - get { - object obj = ResourceManager.GetObject("夜多云", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); + return ((Bitmap)(obj)); } } /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap 夜晴 { + internal static Bitmap 中雨 { get { - object obj = ResourceManager.GetObject("夜晴", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); + object obj = ResourceManager.GetObject("中雨", resourceCulture); + return ((Bitmap)(obj)); } } /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap 夜雨1 { + internal static Bitmap 多云_夜 { get { - object obj = ResourceManager.GetObject("夜雨1", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); + object obj = ResourceManager.GetObject("多云_夜", resourceCulture); + return ((Bitmap)(obj)); } } /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap 夜雪 { + internal static Bitmap 多云_日 { get { - object obj = ResourceManager.GetObject("夜雪", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); + object obj = ResourceManager.GetObject("多云_日", resourceCulture); + return ((Bitmap)(obj)); } } /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap 夜雷阵雨 { + internal static Bitmap 大雨 { get { - object obj = ResourceManager.GetObject("夜雷阵雨", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); + object obj = ResourceManager.GetObject("大雨", resourceCulture); + return ((Bitmap)(obj)); } } /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap 大雨1 { + internal static Bitmap 晴_夜 { get { - object obj = ResourceManager.GetObject("大雨1", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); + object obj = ResourceManager.GetObject("晴_夜", resourceCulture); + return ((Bitmap)(obj)); } } /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap 小雨1 { + internal static Bitmap 晴_日 { get { - object obj = ResourceManager.GetObject("小雨1", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); + object obj = ResourceManager.GetObject("晴_日", resourceCulture); + return ((Bitmap)(obj)); } } /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap 无标题_1 { + internal static Bitmap 暴雪 { get { - object obj = ResourceManager.GetObject("无标题_1", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); + object obj = ResourceManager.GetObject("暴雪", resourceCulture); + return ((Bitmap)(obj)); } } /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap 无标题_1M { + internal static Bitmap 阴 { get { - object obj = ResourceManager.GetObject("无标题_1M", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); + object obj = ResourceManager.GetObject("阴", resourceCulture); + return ((Bitmap)(obj)); } } /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap 日多云 { + internal static Bitmap 阴雨 { get { - object obj = ResourceManager.GetObject("日多云", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); + object obj = ResourceManager.GetObject("阴雨", resourceCulture); + return ((Bitmap)(obj)); } } /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap 日雪 { + internal static Bitmap 雨_夜 { get { - object obj = ResourceManager.GetObject("日雪", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); + object obj = ResourceManager.GetObject("雨_夜", resourceCulture); + return ((Bitmap)(obj)); } } /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap 晴1 { + internal static Bitmap 雨_日 { get { - object obj = ResourceManager.GetObject("晴1", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); + object obj = ResourceManager.GetObject("雨_日", resourceCulture); + return ((Bitmap)(obj)); } } /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap 暴雪1 { + internal static Bitmap 雨夹雪 { get { - object obj = ResourceManager.GetObject("暴雪1", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); + object obj = ResourceManager.GetObject("雨夹雪", resourceCulture); + return ((Bitmap)(obj)); } } /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap 阴1 { + internal static Bitmap 雪 { get { - object obj = ResourceManager.GetObject("阴1", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); + object obj = ResourceManager.GetObject("雪", resourceCulture); + return ((Bitmap)(obj)); } } /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap 阴雨1 { + internal static Bitmap 雪_夜 { get { - object obj = ResourceManager.GetObject("阴雨1", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); + object obj = ResourceManager.GetObject("雪_夜", resourceCulture); + return ((Bitmap)(obj)); } } /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap 雨夹雪1 { + internal static Bitmap 雪_日 { get { - object obj = ResourceManager.GetObject("雨夹雪1", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); + object obj = ResourceManager.GetObject("雪_日", resourceCulture); + return ((Bitmap)(obj)); } } /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap 雪1 { + internal static Bitmap 雷阵雨_夜 { get { - object obj = ResourceManager.GetObject("雪1", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); + object obj = ResourceManager.GetObject("雷阵雨_夜", resourceCulture); + return ((Bitmap)(obj)); } } /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap 雷阵雨1 { + internal static Bitmap 雷阵雨_日 { get { - object obj = ResourceManager.GetObject("雷阵雨1", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); + object obj = ResourceManager.GetObject("雷阵雨_日", resourceCulture); + return ((Bitmap)(obj)); } } /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap 雾1 { + internal static Bitmap 雾 { get { - object obj = ResourceManager.GetObject("雾1", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); + object obj = ResourceManager.GetObject("雾", resourceCulture); + return ((Bitmap)(obj)); } } } diff --git a/MikuWeather_CS/Properties/Resources.resx b/MikuWeather_CS/Properties/Resources.resx index 0d988ca..f2d2a60 100644 --- a/MikuWeather_CS/Properties/Resources.resx +++ b/MikuWeather_CS/Properties/Resources.resx @@ -118,64 +118,58 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + ..\Resources\暴雪1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - + ..\Resources\大雨1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - + ..\Resources\雷阵雨1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - + ..\Resources\晴1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - + ..\Resources\日多云.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - + ..\Resources\日雪.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\无标题_1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\无标题_1M.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - + ..\Resources\雾1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - + ..\Resources\小雨1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - + ..\Resources\雪1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - + ..\Resources\夜多云.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - + ..\Resources\夜雷阵雨.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - + ..\Resources\夜晴.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - + ..\Resources\夜雪.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - + ..\Resources\夜雨1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - + ..\Resources\阴1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - + ..\Resources\阴雨1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - + ..\Resources\雨夹雪1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - + ..\Resources\中雨1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a diff --git a/MikuWeather_CS/Properties/Settings.Designer.cs b/MikuWeather_CS/Properties/Settings.Designer.cs index 5b180ff..0a7372b 100644 --- a/MikuWeather_CS/Properties/Settings.Designer.cs +++ b/MikuWeather_CS/Properties/Settings.Designer.cs @@ -8,15 +8,19 @@ // //------------------------------------------------------------------------------ +using System.CodeDom.Compiler; +using System.Configuration; +using System.Runtime.CompilerServices; + namespace MikuWeather.Properties { - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute( + [CompilerGenerated()] + [GeneratedCode( "Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + internal sealed partial class Settings : ApplicationSettingsBase { private static Settings defaultInstance = - ((Settings) (global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + ((Settings) (Synchronized(new Settings()))); public static Settings Default { diff --git a/MikuWeather_CS/Resources/icon.ico b/MikuWeather_CS/Resources/icon.ico new file mode 100644 index 0000000..6c8f7f8 Binary files /dev/null and b/MikuWeather_CS/Resources/icon.ico differ diff --git a/MikuWeather_CS/icon.ico b/MikuWeather_CS/icon.ico new file mode 100644 index 0000000..6c8f7f8 Binary files /dev/null and b/MikuWeather_CS/icon.ico differ