Skip to content

Commit

Permalink
Added aspx version by surfchris
Browse files Browse the repository at this point in the history
  • Loading branch information
kimmknight committed Jun 27, 2020
1 parent bb25835 commit c28ba41
Show file tree
Hide file tree
Showing 19 changed files with 286 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@ To setup RemoteApps, try [RemoteApp Tool](https://github.com/kimmknight/remoteap
* Webfeed to put RemoteApps in client start menu
* Optional authentication to provide different apps to different users
* File type associations on webfeed clients
* Both ASP and ASP.NET (aspx) versions included (thanks surfchris)

## Download

[Latest](https://github.com/kimmknight/raweb/archive/master.zip)

## Installation
## Quick installation

1. Install IIS and ASP features
2. Copy the contents of the "wwwroot" folder to your inetpub\wwwroot folder.
1. Install IIS and ASP features for Windows
2. Copy the contents of the "asp\wwwroot" folder to your inetpub\wwwroot folder.

## Guides

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
103 changes: 103 additions & 0 deletions aspx/wwwroot/Default.aspx
Original file line number Diff line number Diff line change
@@ -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 changes: 12 additions & 0 deletions aspx/wwwroot/Web.config
Original file line number Diff line number Diff line change
@@ -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>
Binary file added aspx/wwwroot/favicon.ico
Binary file not shown.
Binary file added aspx/wwwroot/icon/testapp.ico
Binary file not shown.
Binary file added aspx/wwwroot/icon32/testapp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added aspx/wwwroot/png/testapp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions aspx/wwwroot/rdp/testapp.rdp
Original file line number Diff line number Diff line change
@@ -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
Binary file added aspx/wwwroot/rdpicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
117 changes: 117 additions & 0 deletions aspx/wwwroot/webfeed.aspx
Original file line number Diff line number Diff line change
@@ -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");
%>

0 comments on commit c28ba41

Please sign in to comment.