By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,225 Members | 2,223 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,225 IT Pros & Developers. It's quick & easy.

activeX Internet Transfer Control licensing issue

P: n/a
Hi,

I'm trying to make an online FTP utility in C# ASP.NET using MSINET.ocx
(an active X control a.k.a. "Microsoft Internet Transfer Control")

I've added the reference into my project and have been able to compile it.
However, when I go to a webpage, and try to FTP something, I get this error:

System.Web.HttpUnhandledException was thrown.(Class is not licensed for use)

I've come across a few arcane articles on how to make a license for ActiveX
controls using LPK but that is for HTML and Client side usage. I also came
across one other article on MSDN that mentions using Visual Studio's LC.exe
("License Complier"). But, I still don't know that it applies to my
situation.. as I'm not building a simple executable file. Or, if it does,
how do I really implement this into my ASP.NET solution?

Thanks for any help,

Brian

Nov 19 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Hi Brian,

Welcome to aspnet newsgroup. From your description, you're encountering
some problems concerned with license when using the Internet Transfer
ACTIVEX control in your aspnet page, yes?

From the exception you provide,

System.Web.HttpUnhandledException was thrown.(Class is not licensed for use)

it was raised by the .net framework at the clientside, are you
encapsulating the Internet Transfre control in your own .net Winform
UserControl and embeded in the web page? If so, is it ok that we directly
use the INet transfer control in page via script code?

From my local test, directlying acessing a InetTransfer component instance
in clientscript works correctly without any problem. Please feel free to
let me know if there is any further concerns. Thanks.

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


Nov 19 '05 #2

P: n/a
No, I'm not doing any FTP operations from the client side. Allow me to
explain a bit more.
I've got some classes I built, using GDI+, which helps the user dynamically
create images. Then, I want the user to be able to transfer the images they
just created on the web server to another hosting production server.
What I've done is provided a simple form on a web page with basic text input
fields (Hostname, Username, Password, LocalFileName, RemoteFileName)

So, when you hit the "TRANSFER" button, the user is actually causing the web
server to connect and transfer the recently created file to another server.
This is all remote. Server-To-Server FTP.. nothing from the browser-side is
being uploaded.

Thus, I added a reference into my "ImageManipulation" project to the
MSINET.ocx (Internet Transfer Objects) control, and then built a class like
thus...

public class FileFTP
{
public static string TransferInetCtl(string Hostname, string UserName,
string Password, string RemoteFileName, string LocalFileName, int
TransferType)
{
InetCtlsObjects.InetClass imgMover = new InetCtlsObjects.InetClass();

string statusUpdate = "";

imgMover.Protocol = InetCtlsObjects.ProtocolConstants.icFTP;
imgMover.UserName = UserName;
imgMover.Password = Password;
imgMover.Execute(Hostname,"Put",LocalFileName,Remo teFileName);
while(imgMover.StillExecuting)
{
......status update pseudo-code.....
}
return GetErrMsg(imgMover.ResponseCode) + "<br>" + statusUpdate;
}

private string GetErrMsg(int errNum){
.....look up codes and return string...
}

}

All of the above should execute and return a string to the calling web form
indicating the final status of the operation, which I then show to the web
browser via a label web control.

Hope that makes sense. In effect, I think I'm attempting to "inhale" the
functionality of the ActiveX object into my own set of dll's to be executed
by a remote web server. Maybe that's not possible?

Thanks in advance for your time.

Brian
"Steven Cheng[MSFT]" wrote:
Hi Brian,

Welcome to aspnet newsgroup. From your description, you're encountering
some problems concerned with license when using the Internet Transfer
ACTIVEX control in your aspnet page, yes?

From the exception you provide,

System.Web.HttpUnhandledException was thrown.(Class is not licensed for use)

it was raised by the .net framework at the clientside, are you
encapsulating the Internet Transfre control in your own .net Winform
UserControl and embeded in the web page? If so, is it ok that we directly
use the INet transfer control in page via script code?

From my local test, directlying acessing a InetTransfer component instance
in clientscript works correctly without any problem. Please feel free to
let me know if there is any further concerns. Thanks.

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


Nov 19 '05 #3

P: n/a
Hi Brian,

Thanks for your followup. From your further description, I've got that
you're just using the INET transfer control at serverside via interop. And
I think the problem shouldn't have anything concerns without code, likely
that the INET ocx control is not registered correclty in your certain
server's registry since its a ocx control shipped with VB6. Is the
webserver that running your code haven't installed the vb6 ? I've also
found the follwoing kb article which has mentioned some of such problems,
you can have a look:

PRB: Errors when you use Visual Basic 6.0 controls in Visual Studio .NET
http://support.microsoft.com/?id=318597

BTW, since what you need to do is transfer file (post from one server to
anthor), is it possbile that we use the buildin HttpWebRequest or
Webclient class under the System.Net namepace which are suitable for
internet programming. I suggest you also considering them.

HTH. Thanks.

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 19 '05 #4

P: n/a
Hi Brian,

Thanks for your followup. From your further description, I've got that
you're just using the INET transfer control at serverside via interop. And
I think the problem shouldn't have anything concerns without code, likely
that the INET ocx control is not registered correclty in your certain
server's registry since its a ocx control shipped with VB6. Is the
webserver that running your code haven't installed the vb6 ? I've also
found the follwoing kb article which has mentioned some of such problems,
you can have a look:

PRB: Errors when you use Visual Basic 6.0 controls in Visual Studio .NET
http://support.microsoft.com/?id=318597

BTW, since what you need to do is transfer file (post from one server to
anthor), is it possbile that we use the buildin HttpWebRequest or
Webclient class under the System.Net namepace which are suitable for
internet programming. I suggest you also considering them.

HTH. Thanks.

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.