Added aspx version by surfchris

This commit is contained in:
Kim 2020-06-27 23:46:36 +10:00
parent bb25835a32
commit c28ba41128
19 changed files with 286 additions and 3 deletions

View File

@ -10,15 +10,16 @@ To setup RemoteApps, try [RemoteApp Tool](https://github.com/kimmknight/remoteap
* Webfeed to put RemoteApps in client start menu * Webfeed to put RemoteApps in client start menu
* Optional authentication to provide different apps to different users * Optional authentication to provide different apps to different users
* File type associations on webfeed clients * File type associations on webfeed clients
* Both ASP and ASP.NET (aspx) versions included (thanks surfchris)
## Download ## Download
[Latest](https://github.com/kimmknight/raweb/archive/master.zip) [Latest](https://github.com/kimmknight/raweb/archive/master.zip)
## Installation ## Quick installation
1. Install IIS and ASP features 1. Install IIS and ASP features for Windows
2. Copy the contents of the "wwwroot" folder to your inetpub\wwwroot folder. 2. Copy the contents of the "asp\wwwroot" folder to your inetpub\wwwroot folder.
## Guides ## Guides

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

View File

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 9.6 KiB

103
aspx/wwwroot/Default.aspx Normal file
View File

@ -0,0 +1,103 @@
<%@ Page language="C#" explicit="true" %>
<script runat="server">
public string GetRDPvalue(string eachfile, string valuename)
{
string GetRDPvalue = "";
string fileline = "";
string theName = "";
int valuenamelen = 0;
System.IO.StreamReader contentfile = new System.IO.StreamReader(eachfile);
valuenamelen = valuename.Length;
while ((fileline = contentfile.ReadLine()) != null)
{
if (fileline.Length >= valuenamelen)
{
string filelineleft = fileline.Substring(0, valuenamelen);
if ((filelineleft.ToLower() == valuename))
{
theName = fileline.Substring(valuenamelen, fileline.Length - valuenamelen);
}
}
}
GetRDPvalue = theName.Replace("|", "");
return GetRDPvalue;
}
</script>
<html>
<head>
<title>
RAWeb - Remote Applications
</title>
<style type="text/css">
a:link {color:#444444;text-decoration:none;}
a:visited {color:#444444;text-decoration:none;}
a:hover{color:#000000;text-decoration:underline;}
a:active {color:#000000;text-decoration:underline;}
#apptile
{
width:150px;
height:135px;
text-align:center;
vertical-align:bottom;
border-style:solid;
border-width:0px;
float:left;
font-size:14px;
font-weight:bold;
}
h1 {
font-family:Arial, Helvetica, sans-serif;
font-size: 30px;
font-style: italic;
color:rgb(0,0,0)
}
body
{
font-family:Arial,sans-serif;
}
</style>
<link rel="shortcut icon" href="favicon.ico">
</head>
<body>
<div style="text-align:left;"><h1>Remote<font style="color:rgb(100,100,100)">Apps</font></h1></div><br>
<%
string appname = "";
string basefilename = "";
string pngname = "";
string pngpath = "";
string Whichfolder = HttpContext.Current.Server.MapPath("rdp\\") + "/";
string[] allfiles = System.IO.Directory.GetFiles(Whichfolder);
foreach(string eachfile in allfiles)
{
string extfile = eachfile.Substring(eachfile.Length - 4, 4);
if (extfile.ToLower() == ".rdp")
{
if (!(GetRDPvalue(eachfile,"full address:s:") == ""))
{
appname = GetRDPvalue(eachfile, "remoteapplicationname:s:");
basefilename = eachfile.Substring(Whichfolder.Length, eachfile.Length - Whichfolder.Length - 4);
if (appname == "")
{
appname = basefilename;
}
pngname = basefilename + ".png";
if (System.IO.File.Exists(HttpContext.Current.Server.MapPath("png\\" + pngname)))
{
pngpath = "png/" + pngname;
}
else
{
pngpath = "rdpicon.png";
}
HttpContext.Current.Response.Write("<div id=apptile>");
HttpContext.Current.Response.Write("<a href=\"" + "rdp/" + eachfile.Substring(Whichfolder.Length, eachfile.Length - Whichfolder.Length) + "\"><img border=0 height=64 width=64 src=\"" + pngpath + "\"><br>" + appname + "</a>");
HttpContext.Current.Response.Write("</div>");
}
}
}
%>
</body>
</html>

12
aspx/wwwroot/Web.config Normal file
View File

@ -0,0 +1,12 @@
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation defaultLanguage="C#" targetFramework="4.0">
</compilation>
</system.web>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".rdp" mimeType="application/rdp" />
</staticContent>
</system.webServer>
</configuration>

BIN
aspx/wwwroot/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

View File

@ -0,0 +1,50 @@
redirectclipboard:i:1
redirectposdevices:i:0
redirectprinters:i:1
redirectcomports:i:1
redirectsmartcards:i:1
devicestoredirect:s:*
drivestoredirect:s:*
redirectdrives:i:1
session bpp:i:32
prompt for credentials on client:i:1
span monitors:i:1
use multimon:i:1
remoteapplicationmode:i:1
server port:i:3389
allow font smoothing:i:1
promptcredentialonce:i:0
authentication level:i:2
full address:s:win7testbox
remoteapplicationprogram:s:||testapp
remoteapplicationname:s:Test Application
remoteapplicationcmdline:s:
alternate full address:s:win7testbox
disableremoteappcapscheck:i:1
alternate shell:s:rdpinit.exe
screen mode id:i:2
winposstr:s:0,3,0,0,800,600
compression:i:1
keyboardhook:i:2
audiocapturemode:i:0
videoplaybackmode:i:1
connection type:i:2
disable wallpaper:i:1
allow desktop composition:i:1
disable full window drag:i:1
disable menu anims:i:1
disable themes:i:0
disable cursor setting:i:0
bitmapcachepersistenable:i:1
audiomode:i:0
redirectdirectx:i:1
autoreconnection enabled:i:1
prompt for credentials:i:0
negotiate security layer:i:1
remoteapplicationicon:s:
shell working directory:s:
gatewayhostname:s:
gatewayusagemethod:i:4
gatewaycredentialssource:i:4
gatewayprofileusagemethod:i:0
use redirection server name:i:0

BIN
aspx/wwwroot/rdpicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

117
aspx/wwwroot/webfeed.aspx Normal file
View File

@ -0,0 +1,117 @@
<%@ Page language="C#" explicit="true" %>
<script runat="server">
public string GetRDPvalue(string eachfile, string valuename)
{
string GetRDPvalue = "";
string fileline = "";
string theName = "";
int valuenamelen = 0;
System.IO.StreamReader contentfile = new System.IO.StreamReader(eachfile);
valuenamelen = valuename.Length;
while ((fileline = contentfile.ReadLine()) != null)
{
if (fileline.Length >= valuenamelen)
{
string filelineleft = fileline.Substring(0, valuenamelen);
if ((filelineleft.ToLower() == valuename))
{
theName = fileline.Substring(valuenamelen, fileline.Length - valuenamelen);
}
}
}
GetRDPvalue = theName.Replace("|", "");
return GetRDPvalue;
}
public string Root()
{
string DocPath = HttpContext.Current.Request.ServerVariables["PATH_INFO"];
string[] aPath = ("/" + DocPath).Split('/');
string Root = DocPath.Substring(0, (DocPath.Length - aPath[aPath.GetUpperBound(0)].Length));
return Root;
}
</script>
<%
string ServerName = System.Net.Dns.GetHostName();
string datetime = DateTime.Now.Year.ToString() + "-" + (DateTime.Now.Month + 100).ToString().Substring(1, 2) + "-" + (DateTime.Now.Day + 100).ToString().Substring(1, 2) + "T" + (DateTime.Now.Hour + 100).ToString().Substring(1, 2) + ":" + (DateTime.Now.Minute + 100).ToString().Substring(1, 2) + ":" + (DateTime.Now.Second + 100).ToString().Substring(1, 2) + ".0Z";
HttpContext.Current.Response.Write("<ResourceCollection PubDate=\"" + datetime + "\" SchemaVersion=\"1.1\" xmlns=\"http://schemas.microsoft.com/ts/2007/05/tswf\">" + "\r\n");
HttpContext.Current.Response.Write("<Publisher LastUpdated=\"" + datetime + "\" Name=\"" + ServerName + "\" ID=\"" + ServerName + "\" Description=\"\">" + "\r\n");
HttpContext.Current.Response.Write("<Resources>" + "\r\n");
string Whichfolder = HttpContext.Current.Server.MapPath("rdp\\") + "/";
string[] allfiles = System.IO.Directory.GetFiles(Whichfolder);
foreach (string eachfile in allfiles)
{
string extfile = eachfile.Substring(eachfile.Length - 4, 4);
if (extfile.ToLower() == ".rdp")
{
if (!(GetRDPvalue(eachfile, "full address:s:") == ""))
{
string basefilename = eachfile.Substring(Whichfolder.Length, eachfile.Length - Whichfolder.Length - 4);
string appalias = GetRDPvalue(eachfile, "remoteapplicationprogram:s:");
string apptitle = GetRDPvalue(eachfile, "remoteapplicationname:s:");
string appicon = basefilename + ".ico";
string appicon32 = basefilename + ".png";
string apprdpfile = basefilename + ".rdp";
string appresourceid = appalias;
string appftastring = GetRDPvalue(eachfile, "remoteapplicationfileextensions:s:");
string appfulladdress = GetRDPvalue(eachfile, "full address:s:");
string rdptype = "RemoteApp";
if (appalias == "")
{
rdptype = "Desktop";
appalias = basefilename;
apptitle = basefilename;
appresourceid = basefilename;
}
else
{
rdptype = "RemoteApp";
}
DateTime filedatetimeraw = System.IO.File.GetLastWriteTime(eachfile);
string filedatetime = DateTime.Now.Year.ToString() + "-" + (filedatetimeraw.Month + 100).ToString().Substring(1,2) + "-" + (filedatetimeraw.Day + 100).ToString().Substring(1,2) + "T" + (filedatetimeraw.Hour + 100).ToString().Substring(1,2) + ":" + (filedatetimeraw.Minute + 100).ToString().Substring(1,2) + ":" + (filedatetimeraw.Second + 100).ToString().Substring(1,2) + ".0Z";
HttpContext.Current.Response.Write("<Resource ID=\"" + appresourceid + "\" Alias=\"" + appalias + "\" Title=\"" + apptitle + "\" LastUpdated=\"" + filedatetime + "\" Type=\"" + rdptype + "\">" + "\r\n");
HttpContext.Current.Response.Write("<Icons>" + "\r\n");
HttpContext.Current.Response.Write("<IconRaw FileType=\"Ico\" FileURL=\"" + Root() + "icon/" + appicon + "\" />" + "\r\n");
if (System.IO.File.Exists(HttpContext.Current.Server.MapPath("icon32/" + appicon32)))
{
HttpContext.Current.Response.Write("<Icon32 Dimensions=\"32x32\" FileType=\"Png\" FileURL=\"" + Root() + "icon32/" + appicon32 + "\" />" + "\r\n");
}
HttpContext.Current.Response.Write("</Icons>" + "\r\n");
if (appftastring != "")
{
HttpContext.Current.Response.Write("<FileExtensions>" + "\r\n");
string[] appftaarray = appftastring.Split(',');
foreach(string filetype in appftaarray)
{
string docicon = basefilename + "." + filetype + ".ico";
HttpContext.Current.Response.Write("<FileExtension Name=\"" + filetype + "\" PrimaryHandler=\"True\">" + "\r\n");
HttpContext.Current.Response.Write("<FileAssociationIcons>" + "\r\n");
HttpContext.Current.Response.Write("<IconRaw FileType=\"Ico\" FileURL=\"" + Root() + "icon/" + docicon + "\" />" + "\r\n");
HttpContext.Current.Response.Write("</FileAssociationIcons>" + "\r\n");
HttpContext.Current.Response.Write("</FileExtension>" + "\r\n");
}
HttpContext.Current.Response.Write("</FileExtensions>" + "\r\n");
}
else
{
HttpContext.Current.Response.Write("<FileExtensions />" + "\r\n");
}
HttpContext.Current.Response.Write("<HostingTerminalServers>" + "\r\n");
HttpContext.Current.Response.Write("<HostingTerminalServer>" + "\r\n");
HttpContext.Current.Response.Write("<ResourceFile FileExtension=\".rdp\" URL=\"" + Root() + "rdp/" + apprdpfile + "\" />" + "\r\n");
HttpContext.Current.Response.Write("<TerminalServerRef Ref=\"" + ServerName + "\" />" + "\r\n");
HttpContext.Current.Response.Write("</HostingTerminalServer>" + "\r\n");
HttpContext.Current.Response.Write("</HostingTerminalServers>" + "\r\n");
HttpContext.Current.Response.Write("</Resource>" + "\r\n");
}
}
}
HttpContext.Current.Response.Write("</Resources>" + "\r\n");
HttpContext.Current.Response.Write("<TerminalServers>" + "\r\n");
HttpContext.Current.Response.Write("<TerminalServer ID=\"" + ServerName + "\" Name=\"" + ServerName + "\" LastUpdated=\"" + datetime + "\" />" + "\r\n");
HttpContext.Current.Response.Write("</TerminalServers>" + "\r\n");
HttpContext.Current.Response.Write("</Publisher>" + "\r\n");
HttpContext.Current.Response.Write("</ResourceCollection>" + "\r\n");
%>