Beispiel #1
0
    protected void initClientOS()
    {
        WindowsRequirements.Visible = false;
        MacOSRequirements.Visible   = false;

        SupportedOSs clientOS = ClientOS;

        switch (clientOS)
        {
        case SupportedOSs.WinXP:
            string userAgent = Request.ServerVariables["HTTP_USER_AGENT"];
            if (userAgent != null)
            {
                if (userAgent.IndexOf(".NET CLR 3.0.04506.30") >= 0)
                {
                    NetVersionMessage.Text = "<br /><i>* You appear to already have .NET 3.0 installed. *</i>";
                }
                else if (userAgent.IndexOf(".NET CLR 2.0.50727") >= 0)
                {
                    NetVersionMessage.Text = "<br /><i>* You appear to already have .NET 2.0 installed. *</i>";
                }
            }

            WindowsRequirements.Visible = true;

            DownloadApplication.AlternateText = "Download for Windows";
            DownloadApplication.ImageUrl      = "~/Images/Download-For-Windows-Button.gif";

            break;

        case SupportedOSs.MacOSX:

            MacOSRequirements.Visible = true;

            DownloadApplication.AlternateText = "Download for Mac OS X";
            DownloadApplication.ImageUrl      = "~/Images/Download-For-MacOSX-Button.gif";

            break;

        default:
            throw new NotSupportedException(string.Format("{0} is not a supported client operating system.",
                                                          clientOS.ToString("g")));
        }
    }
Beispiel #2
0
    protected void DownloadApplication_Click(object sender, EventArgs e)
    {
        SupportedOSs clientOS = ClientOS;

        switch (clientOS)
        {
        case SupportedOSs.WinXP:
            Response.Redirect("~/Members/Tray-Application/RankTrend-Tray-Application.msi");
            break;

        case SupportedOSs.MacOSX:
            Response.Redirect("~/Members/Tray-Application/RankTrend-Tray-Application.dmg");
            break;

        default:
            throw new NotSupportedException(
                      string.Format("{0} is not a supported client operating system.  There is no download for this operating system.",
                                    clientOS.ToString("g")));
        }
    }