J
JDeats
I have a WinForms based application that I'm launching over http
(Microsoft's buzz word for this is aparently "SmartClient"). I had an
issue trying to get parameters passed in through the URL that I
thought I had solved. For example, let's say I wanted to do this:
http://myserver/appdir/mywinformapp.exe?username=joe&age=12
Providing code access security permissions allow it, mywinformapp.exe
is downloaded to the client and launches though IEExec.
I found a way to get to the QueryString params though:
Environment.GetCommandLineArgs(); this command returns a string array
with two entries, the second entry is:
http://myserver/appdir/mywinformapp.exe?username=joe&age=12#12ABF5C3FX...
It's the full URL plus the session hash code. I built a parser method
to strip out the name/value pairs of the QueryString nad all was well,
then for no apparent reason the app started having problems extracting
the command line args (it begin adding a .config on to the end and
attempting to load a .config file that didn't exist). The .NET
Framework began returning a run-time error when the app lunches that
says "Error loading XML file:
http://myserver/appdir/mywinformapp.exe?username=joeage=12.config",
it's as if the application is looking for an app.config file and
trying to resolve it's location from the
Environment.GetCommandLineArgs().
Does anyone know how to resolve this?
(Microsoft's buzz word for this is aparently "SmartClient"). I had an
issue trying to get parameters passed in through the URL that I
thought I had solved. For example, let's say I wanted to do this:
http://myserver/appdir/mywinformapp.exe?username=joe&age=12
Providing code access security permissions allow it, mywinformapp.exe
is downloaded to the client and launches though IEExec.
I found a way to get to the QueryString params though:
Environment.GetCommandLineArgs(); this command returns a string array
with two entries, the second entry is:
http://myserver/appdir/mywinformapp.exe?username=joe&age=12#12ABF5C3FX...
It's the full URL plus the session hash code. I built a parser method
to strip out the name/value pairs of the QueryString nad all was well,
then for no apparent reason the app started having problems extracting
the command line args (it begin adding a .config on to the end and
attempting to load a .config file that didn't exist). The .NET
Framework began returning a run-time error when the app lunches that
says "Error loading XML file:
http://myserver/appdir/mywinformapp.exe?username=joeage=12.config",
it's as if the application is looking for an app.config file and
trying to resolve it's location from the
Environment.GetCommandLineArgs().
Does anyone know how to resolve this?