This project is read-only.

Examples for ASP.Net

Nov 23, 2009 at 7:37 PM

Do you have any examples of using the codeset in a ASP.NET Web Site.  As I have the need to create a VPN connection to potentially copy some files over to a remote server.



Nov 23, 2009 at 9:35 PM

It should work the same as any other application, other than you'll need to change the user account the app pool is using. The Network Service account most websites run under probably won't have enough privileges to dial connections.

Question: If your web server changes networks will that break your website? Once you call Dial, the server with the website on it is going to change networks which the original network where the request originated may no longer be available.

FYI: I've never tested this project inside an ASP.NET application, I'm interested to see how it will react in that environment.

Nov 23, 2009 at 9:45 PM

Good question.  I really struggling to come up with a solution to this problem.  I'm trying to deposit a file on a remote server, when Impersonation doesn't seem to want to work, and it looks like FTP is off the table.  I want to do it programmatically, but it seems I'm running out of options.

Nov 23, 2009 at 10:02 PM

At a minimum you'll need another machine (machine B) on your network to handle uploading the files for you without interrupting service for your website users.

The easiest solution would be to create a Windows Service running on machine B that uses a set interval to upload any files that have been queued for upload since the last time it uploaded. A simple database table could be used to maintain the list of files that have to be uploaded and those that have not been queued. When the timer elapses, check the table for any records that have not been uploaded, grab all the file details that are on the server to upload, connect the VPN programmatically, and then perform the upload. Once the files are uploaded, disconnect the VPN connection and update the database to indicate which records have been uploaded successfully. Just don't forget to stop the timer during the upload to prevent the machine trying to connect to database while the VPN is active. Restart the timer once the upload process has been completed.

You can use AJAX from your web page to notify the user the status of their upload (if it in fact requires any status updates to a user). Just have it check a flag in the table to see what's going on with whichever file the user is trying to upload.

Just some ideas you might find useful. Let me know if there's anything else I can do.

Nov 24, 2009 at 3:00 PM

I've thought about that as well.  Except the file that needs to be uploaded gets created right before it needs to be uploaded.  It's a Crystal report .pdf, I then concatenate more .pdfs to this file using ITextSharp.  This file must be moved to the remote server immediately, as I send an email alert to the 3rd party that the file has been created on their server.

Nov 24, 2009 at 4:19 PM

Well the only way you could do it immediately is with some kind of synchronous transfer mechanism. Which file processes are typically asynchronous due to the delay involved with moving files. Add separate networks into that and if it's not asynchronous you're going to have some major delay on your UI.

If the email is the problem, you can always have the file transfer server send out the email after the server has successfully uploaded the file and disconnected from the remote network. You'd want it designed like that anyway, since there might be a problem during the upload process or high latency taking a long time for the upload to complete.