Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

passing data from an asp page to another application? 1

Status
Not open for further replies.

idontknowtryit

Electrical
Aug 11, 2005
3
What I want to do is read and write to the parallel port
from a asp or aspx web page. I have written the program that can read and write to the parallel port, but need some way to get data from asp/aspx page to this application.

I have it working now by writing a file to the server then reading that file with my app. I'm looking for a more effcient way.

Is there a way to get application variables from an asp page to an exe.?

I've tried this from another web site
WshShell = CreateObject("WScript.Shell")
WshShell.Run("C:\ConsoleApplication1 "& sendValue)
WshShell = Nothing
But get access denied errors?

Whats the best way to do this?
I'm not a programmer so dumb it down the best you can :)
I'm using XP pro, vb.net Std and IIS
 
Replies continue below

Recommended for you

Access denied is to do with your IE settings.
See if this works - create 2 files hello.vbs and hello.htm
hello.vbs
Code:
WScript.echo "hello"
hello.htm
Code:
<html>
<body>
	<script language="vbscript">
		set objShell=CreateObject("Wscript.shell")
		objShell.Run "wscript F:\scr\60009\hello.vbs",1,false
	</script>
</body>
</html>
run hello.htm from IE. If that works, then the problem is in what you put after the word Run.
 
Sorry - hello.htm should look like
Code:
<html>
<body>
    <script language="vbscript">
        set objShell=CreateObject("Wscript.shell")
        objShell.Run "wscript hello.vbs",1,false
    </script>
</body>
</html>
If that doesn't work then put down the full path name of hello.vbs
 
That will only run the exe. on the client side right?
I need a way to run it on the server. I found Aspexec.dll
that looks promising , but haven't got it working yet.
 
Don't quite understand this - you are on a PC connected to an ASP server. You want to invoke a web page on a server that will get data from somewhere and return it to the server. The server in turn will write this data out to the parallel port. In that case you'll have to use something like this. You will have to give your page an asp extension
Code:
<html>
<body>
<%
   set objShell=CreateObject("Wscript.shell")
   objShell.Run "your.exe "&request("data"),1,false
%>
Done
</body>
</html>
There should be a separate page posting the data to this page.
 
That works. I actually tried that at first but could not get it to work. To make Aspexec.dll work I had to make changes to 4 or 5 services to allow them to interact with the desktop. Those changes maybe the reason it works now.
Thank you for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor