activeX Internet Transfer Control licensing issue

B

Brian

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
 
S

Steven Cheng[MSFT]

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.)
 
G

Guest

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,RemoteFileName);
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
 
S

Steven Cheng[MSFT]

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.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top