-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPackageInfo.aspx.cs
59 lines (54 loc) · 2.11 KB
/
PackageInfo.aspx.cs
1
2
3
4
5
6
7
8
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using System.Text;
public partial class PackageInfo : System.Web.UI.Page
{
string sdkRoot = "C:\\Inetpub\\wwwroot\\sdk\\";
private string GetHtml(string file)
{
if (File.Exists(file))
{
StringBuilder retval = new StringBuilder();
using (System.IO.FileStream s = System.IO.File.OpenRead(file))
{
using (System.IO.StreamReader reader = new System.IO.StreamReader(s))
{
string line;
while ((line = reader.ReadLine()) != null)
{
if (retval.Length > 0)
retval.Append("<br/>");
retval.Append(line);
}
return retval.ToString();
}
}
}
return "No information available";
}
protected void Page_Load(object sender, EventArgs e)
{
string file = this.Request.QueryString["file"];
if (file == null)
return;
topictitleDiv.InnerHtml = "General Information about the <span class=\"filename\">" + file + "</span> package";
file = Path.GetFileNameWithoutExtension(file);
string target = sdkRoot + "downloads\\doc\\" + file + "\\ms_version.txt";
msversionDiv.InnerText = GetHtml(target);
target = sdkRoot + "downloads\\doc\\" + file + "\\ms_deps.txt";
msdepsDiv.InnerHtml = GetHtml(target);
target = sdkRoot + "downloads\\doc\\" + file + "\\gdal_version.txt";
gdalversionDiv.InnerHtml = GetHtml(target);
target = sdkRoot + "downloads\\doc\\" + file + "\\gdal_formats.txt";
gdalformatsDiv.InnerHtml = GetHtml(target);
target = sdkRoot + "downloads\\doc\\" + file + "\\ogr_formats.txt";
ogrformatsDiv.InnerHtml = GetHtml(target);
target = sdkRoot + "downloads\\doc\\" + file + "\\gdal_deps.txt";
gdaldepsDiv.InnerHtml = GetHtml(target);
}
}