Skip to content

Commit

Permalink
Added version display to User-Agent.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mizore committed Jul 21, 2013
1 parent 30249d9 commit 4f15b98
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Beatmap Mirror WPF/Code/Api/ApiRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public string SendRequest()
{
WebClient wc = new WebClient();
wc.Proxy = null;
wc.Headers.Add("User-Agent", "Osu!Mirror");
wc.Headers.Add("User-Agent", string.Format("Osu!Mirror {0}", Configuration.VersionString));

try
{
Expand All @@ -85,7 +85,7 @@ public string SendRequest()

HttpWebRequest r = (HttpWebRequest)WebRequest.Create(location);
r.Method = "GET";
r.UserAgent = "Osu!Mirror";
r.UserAgent = string.Format("Osu!Mirror {0}", Configuration.VersionString);

using (WebResponse response = r.GetResponse())
{
Expand Down
5 changes: 5 additions & 0 deletions Beatmap Mirror WPF/Code/Configuration.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using Beatmap_Mirror_WPF.Code.Tools;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Reflection;
using System.Text;

namespace Beatmap_Mirror.Code
Expand All @@ -17,6 +19,8 @@ public static class Configuration
public static string Mp3DownloadLocation = null;
public static string OsuLocation = null;

public static string VersionString = null;

public static bool AskBeforeClose = true;

public static int ParrarelDownloads = 2;
Expand All @@ -25,6 +29,7 @@ public static void Innit()
{
ServicePointManager.DefaultConnectionLimit = int.MaxValue;

VersionString = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).FileVersion;

string temp = RegistryHelper.GetKey("ParrarelDownloads");
if (temp != null)
Expand Down
8 changes: 4 additions & 4 deletions Beatmap Mirror WPF/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
[assembly: AssemblyTitle("Beatmap Mirror WPF")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyCompany("Hexide")]
[assembly: AssemblyProduct("Beatmap Mirror WPF")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[assembly: AssemblyCopyright("Copyright © Hexide 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand Down Expand Up @@ -51,5 +51,5 @@
// 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")]
[assembly: AssemblyVersion("1.0.0.1")]
[assembly: AssemblyFileVersion("1.0.0.1")]

0 comments on commit 4f15b98

Please sign in to comment.