topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 9:27 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Visual Web Developer 2008 - newbie questions and help requests  (Read 9762 times)

wreckedcarzz

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 1,626
    • View Profile
    • Donate to Member
Alright, as the topic name suggests, I am giving web programming a shot.

I am somewhat intermediate (IMO) in Visual Basic .NET 08, so I figure that I'll make an attempt to put my "SystemCare" app (part of my SnapSuite app) online, so that people don't have to download an entire program (or carry it around on a USB thumbdrive, etc).

So I have the (somewhat lame) interface setup on the ASPX file, and I go ahead and start writing code for the click event, similar to what I would do for Visual Basic. Web Developer tells me that I cannot use the Process.Start command, unless I do it though System.Diagnostics. So, I go ahead and apply the fix, and continue working. Now I test. When I click the button, it comes up.... with a "Save File" dialog (in Firefox).

Now, the code works correctly - the bad part is, I want it to be able to download and then run the files (EXEs) silently, without user intervention. One-click, "Now working", be done with it.

I know that "this could be used for malicious actions" and "ZOMG ITS A VIRUS!!!11!1!!!" ... but all I am looking for is a way to silently run executable files from the internet. No bull.

Anyone here got ideas? I've tried several methods (changing the Process.Start to start a "file://" and not an "http://", for example) and nothing works. I tinkered around looking for a silent/download/process.start.silent/etc options, and no avail.

Code: vb.net [Select]
  1. Imports System.Diagnostics
  2.  
  3. Partial Class _Default
  4.     Inherits System.Web.UI.Page
  5.  
  6.     Protected Sub CleanupButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles CleanupButton.Click
  7.         'FileCopy("http://mazecraze.dcisv.com/SystemCareOnline/InstantSweep.exe", "C:\temp\SystemCareOnline\InstantSweep.exe")
  8.         Process.Start("http://mazecraze.dcisv.com/SystemCareOnline/InstantSweep.exe")
  9.  
  10.     End Sub
  11. End Class

As of right now I only have that little bit of code, as I need to get it working before I get the other buttons working (otherwise it would be more code that didn't work).

Suggestions? Ideas? Something I am missing? Another method to do it? :tellme:

-Brandon

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
Re: Visual Web Developer 2008 - newbie questions and help requests
« Reply #1 on: June 17, 2008, 06:21 AM »
You'd have to make an ActiveX object (which will only run in internet explorer) or java applet then because of security limitations it's not possible to silently run executables without a sandbox.

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: Visual Web Developer 2008 - newbie questions and help requests
« Reply #2 on: June 17, 2008, 08:22 AM »
You'd have to make an ActiveX object (which will only run in internet explorer) or java applet then because of security limitations it's not possible to silently run executables without a sandbox.
And thanks goodness for that.

Also, you cannot "run applications over the internet" - the whole executable has to be downloaded to the client machine first. This also goes for ActiveX objects, but that would happen silently of course. ActiveX isn't all-trivial to code, and you'll need to pay out to get your control digitally signed... so probably not an option for you.
- carpe noctem

wreckedcarzz

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 1,626
    • View Profile
    • Donate to Member
Re: Visual Web Developer 2008 - newbie questions and help requests
« Reply #3 on: June 17, 2008, 06:03 PM »
I figured it would have to download first anyways, but I don't know *anything* about Java, but I have a couple friends that do; that, and I am taking my programming class this fall, and that includes Java...

OK, at least I know now. :)

Veign

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 993
    • View Profile
    • Veign - Where design meets development
    • Donate to Member
Re: Visual Web Developer 2008 - newbie questions and help requests
« Reply #4 on: June 17, 2008, 07:09 PM »
Thank God this can not be done and as time and browser versions increase the browsers are even further protecting the user from accidentally running something malicious.

cai

  • Participant
  • Joined in 2009
  • *
  • Posts: 1
    • View Profile
    • Donate to Member
Re: Visual Web Developer 2008 - newbie questions and help requests
« Reply #5 on: January 05, 2009, 08:57 AM »
hi, im trying to insert flash into my database in visual web but it seem that it cannot be done.. is there any way that i can do it? or it is not possible to insert flash into the database and only on the aspx page.

CWuestefeld

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,009
    • View Profile
    • Donate to Member
Re: Visual Web Developer 2008 - newbie questions and help requests
« Reply #6 on: January 05, 2009, 09:08 AM »
You can put anything you want into a DB (depending on the DB engine you're using). If you're using SQL Server, for example, you'd want to declare the column as type VARBINARY(MAX). The way to insert the flash into the DB is just like you'd insert anything else: get the data (probably by writing a program that reads the bits from the .swf file) and then insert it into the DB. I understand that SQL Server 2008 has a way to pass through stuff like this so it actually gets stored in the filesystem, but I haven't tried it.

The challenging part here is getting the flash back out in a usable fashion. You'd normally just EMBED an object into the HTML that refers to the .swf file. When the browser want the flash, it sends a request to your server that downloads that file. The thing is, you've no longer got a file -- you stuffed it into the database! So you've got to make a page that reads the database and streams it back to the user (rather than returning HTML as you normally would), and use that as the URL of the object in the EMBED.

I've done this all before, but in my experience it's rarely worth the trouble. Generally you can get what you need just by storing the path/filename of the SWF and serving that out when page is constructed.