Google Answers Logo
View Question
 
Q: ActiveX in .NET ( No Answer,   2 Comments )
Question  
Subject: ActiveX in .NET
Category: Computers > Programming
Asked by: the_lame_duck-ga
List Price: $10.00
Posted: 15 Sep 2006 08:46 PDT
Expires: 15 Oct 2006 08:46 PDT
Question ID: 765574
I would like to create a web based program in .NET that can read/write
to the user's hard drive.  Clearly, security issues prevent this.  I
understand that ActiveX is one method around this, however I can only
find VB6 tutorials on this.

What is the .NET solution?  Can ActiveX controls be created in .NET
that can have access to the user's computer as if they downloaded and
installed the application?

A simple yes/no, and a link to a site fully exploring this question
would be sufficient.

Thank you very much.
Answer  
There is no answer at this time.

Comments  
Subject: Re: ActiveX in .NET
From: progs-ga on 30 Sep 2006 15:52 PDT
 
Hi, 

certainly it is possible, it is simple. Create library with the
necessary class, and necessarily (!) install in GAC. After that by
means of the utility regasm (for example, regasm ActivXObject.dll) can
to register in COM.

so it's small example:

/*
   File: FunnyWorld.cs
   Author: Vladimir V.
*/

using System;
using System.Windows.Forms;
using System.Reflecation;

[assembly: AssemblyKeyFile("Keys.snk")]

public class FunnyWorld
{
	public void SayHello(string param)
	{
		MessageBox.Show(param, "FunnyWorld::SayHello method was invoked");
	}
}

We should make assembly of the given source code, and it necessarily
should be strong-named. It is required to place it in GAC. In detail
about it in the help (.NET Framework SDK).

-----------------------------

/* Some.html */

<html>
	<body>
	<script language="JScript">
		function onJClick()
		{
			x = new ActiveXObject("FunnyWorld");
			x.SayHello("Hello World from DHTML web page");
		}
	</script>
	....
	</body>
</html>
Subject: Re: ActiveX in .NET
From: viewdu-ga on 12 Oct 2006 23:45 PDT
 
Hi there,

Furthermore, create your c# project as a .dll library, and then you
can embed it as a GUI onto the webpage.

Just add to your html :

<html>
<head>
</head>
<body>
    <object id="ReportResult" height="540" width="540"
       classid="http://your-website/your.dll#your-namespace.YourClass">
  <param name="UserId" value="WHOEVER" />
  <param name="Server" value="WHEREEVER" />
  </object>
</body>
</html>

You can incorporate WebServices to create Remote Procedure Call
functionality back to the server too.

Cheers

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy