Background tasks, if users are on the website - asp.net

I have a bit of an issue here. Actually, it might not be an issue, I just don't really know how to handle it.
I need to copy an image, from a remote server, to my local server, every n seconds, IF (any) users are on my webpage.
If no users are on, it doesn't matter. If multiple users are on, it should only run the copy once (every n seconds).
I think I have heard somewhere, that you can do background tasks, on your ASP.NET website, but I have absolutely no knowledge of this. Some people also talk about threads, is it perhaps the same solution?
So, I'm hoping for some experienced people, to guide me towards a solution here. What possibilities do I have, which would you recommend and perhaps some articles where I can read how to do it.

Given your answer in the comments I would suggest you need to use a cache that supports time-based expiry.
See http://www.codeproject.com/Articles/51409/Exploring-Caching-Using-Caching-Application-Enterp#heading0020 for a good article on using Enterprise Library caching block.

Related

asp.net secure my application so no one can transfer it and reuse it

I'm making an asp.net web application which will run locally on IIS
for a single user
I don't want this user to access my application files (in the www root ) or bring another programmer and steal my code
I just want the user to have the ability to access the website only and
stop any programmer from knowing my source code
I heard about an USB security system called "Dongle" but can it be used in a situation like this ?
any Ideas ?
thanks in advance
The website is just running code, but like anything, once the user has it they can do what they like to it, whether you like it or not. That's why there is a multi-million {currency} industry around securing applications.
You could use dongles but they're expensive and not trivial to implement. As #volleyball said, obfuscation would slow down most people from decompiling your app. without odfucation any licensing or dongles could just be patched out of your code.
Your most secure route would be to not give it to them. It's a web app, host it. This may not of course not meet your requirements.
Simon
I have never heard of a web application that uses a dongle. This is normally reserved for regular windows apps; and even then it's falling out of vogue. Generally speaking some of the more expensive software packages still use them.
However, the cost of duplicating a dongle is pretty low. Combined with the fact that getting around such security is relatively easy anyway and you have a situation in which you really shouldn't bother.
As Simon said, if it's a web app host it. Otherwise obfuscate it.
If neither of those are possible, then I'd recommend you change your licensing deal with your client to include the possibility of them going elsewhere. Perhaps for an additional charge you'll give them a non-exclusive site license permitting them to do whatever they want with the code short of selling it or giving it to another entity.
did you look at obfuscators. They do a good job at encrypting code. 99% of the time your code cannot be reverse engineered. But if someone sits on your stolen code they can reverse engineer.. In the sense that ordinary people may not obfuscate it. If the person is very intellingent, he will not reverse engineer he will write better code.

Storing pictures in MySQL - Smart?

I know this is an age old question, and usually you can't get a simple answer.
However, I'm in the situation where I might need 20gb of storage for pictures on a collaborative web app I'm creating using ASP.NET MVC, but my web host doesn't give me more than 4gb of storage. However - I have unlimited space on my MySQL DB, so I'm seriously considering using the longblob or something in the MySQL DB as storage - can anyone give me a couple of reasons why not go this way? The alternative would be a very expensive host, or a possibly equally expensive solution with cloud storage (I'm thinking Amazon S3 or something).
Thanks!
Not smart. Because unless your webhost is very dumb, they will notice and tell you to stop being silly.
"Unlimited" very rarely actually means "unlimited".
This is not much lines of code, try and check what solution is better for you problem.
I think if you have unlimited DB Storage and you doesn't matter on bandwidth between database server and run time environment then probably this solution might be better for you.
It's not really an age old question with no simple answer - it's simply inappropriate to store image data in a database.
Using it as a workaround for limited disk space is simply going to cause other issues, such as the fact that it'll be a lot slower to load and it's likely the hosting company will pull the plug once they realise what's going on. (If they're the kind of company that limits you to 4GB of local disk space, then I also have to wonder whether their MySQL set up will cope with serving up image content.)

How to encrypt your files online so no one can use it in future?

I know it may sound silly, but i worked for a client that seems not willing to pay me, but is making money with his website...i still have access to the ftp...so, i'm not going to tear down the website if he doesnt pay, but i would at least protect my code that i gave him...so in case i'm sure that he cant resell or use again...
http://www.zend.com/en/products/guard/
If you code for your client in PHP, this will prevent reverse engineering, and you can set the application to expire after a certain amount of time. There are numerous other licensing options available.
I think you have a deeper problem though, you should really talk to your client or get a third-party mediator to resolve this. At the very least, you should receive a deposit. Contracts will also give you some legal leverage, so you should have signed one before you started work.
what form is your code? html? js? java? c#? you can obfuscate js, for java (or .jar file) you can use the strip/pack tools as detailed here.
in general, obfuscation seems to be pretty effective for all of them (even html, if the bulk of it is generated through scripts :p )
Consider the next poor guy that your client recruits to manage that code... And consider the ramifications - because his impression of you will be based on that code!
If your code is written in ASP.NET, you should obfuscate it (Visual Studio comes with the community edition of Obfuscator), but there're probably better obfuscatation tools than that one.
On a side note, I got my code and last payment actually stolen by a client (the binaries not the code itself, but he managed to disassemble the code with help from a developer. Unfortunately it's too easy with .NET). This is one case where I really regret not obfuscating the code.
First, don't do anything that could be taken as a malicious attack against your client. Messing with their FTP after they have ceased communication could land you in hot water.
Second, if they haven't yet given you a cent for your work then AFAIK you still own the full rights to that work. (i.e. the copyrights on the code etc. you provided) If they use your code, without a license and without paying then they are committing copyright infringement.
This is all legalese, but I'm not a lawyer. Talk to an attorney before acting on copyright.

WebSite Deployment Skills

We need to increase our knowledge on deployment of ASP.NET Web sites/Web App. We are getting increasingly bigger and more traffic and need a more professional approach. Not too mention, we are also moving up to multiple database/multiple back end/ multiple front end server deployments and we just don't want to screw it up.
What type of skills should we be looking for and is there a typical title people with these skills use?
Thanks,
Actually, We have most of the talents the two answers mention, what we are looking for is I guess what Dave calls the web server guru. I simply want someone to handle the deployment aspect. The developers we have need to be working on their end of it not trying to figure out dpeloyment best practices. Also, we may end up with multiple projects and teams and I don't think each team having a seperate person rolling their own solutions would be as good as 1 dedicated resource for all the teams.
If you're looking to take an ASP.NET application to the next level, you need the development talent.
At least four years of intensive ASP.NET development experience.
A current certification to go with the experience would be good, but don't take the cert over the experience.
Find someone familiar with the techniques used in your app- if it's a Webforms app, don't go looking for an MVC wizard unless he/she also has the Webforms chops, etc.
It sounds like you may be handling the hosting yourself. If this is the case, you may also need to either hire a webserver guru or look into managed hosting. Don't be snookered into thinking you can get your dev to care and feed the hosting environment, it's too much work for one person.
Sounds like you will need at least three people, as the skills may not typically be what one person can do.
You may need a database administrator, to ensure that your multiple databases stay in sync, or backed up properly and configured correctly.
You will need a sysadmin to set up the multiple webservers and to ensure that all the hardware and infrastructure is configured properly.
And, you will need .NET developer that knows ASP.NET as well as the database layer.
If you were hosted then the first two you don't need as your hosting site would be responsible.
If you went with cloud computing then the same, you don't need the first two.
But, regardless, sounds like you need the third.
For the developer, you need to be careful about what skills you need, for example, C# for 4 yrs, ASP.NET for 2yrs, if you need javascript or css then specify that. If you are using any particular libraries then specify that.

Playing video on a dynamic website

Hi I am currently designing a website for a client - the site will be written in asp.net with a cms built in. My client has come back saying he wants to play mp4s on the site - plus being able to embed some other videos from youtube, vimeo etc.... in his blog - I have managed to convice my client that playing .flv would be better for obvious reasons (which he has agreed is OK). but when I went back to my coder, he said that because of the fact its a dynamic site that it will take 2 days to get this working (in terms of creating the mechanics to allow my client to up load his movies etc.....)
Is this correct - as my client is under the impression that it should be a simple thing to do - while my coder tells me that its not that simple.
I am in the middle of all of this - can you help please!!!!
At the end of the day only the coder you are using knows exactly how much effort is required here. You have to trust them. This almost certainly not trivial. Make sure you and the coder understand exactly what's being asked for here and that neither of you are assuming anything about how the client expects it to work.
Is your client a programmer? Non-programmers should never dictate how long a programming task should take.
If you're cowboy coding without testing "today" would probably suffice, but any sane and professional development shop would never let this happen.
Now let's clarify what your client really told you to do:
Your dev seems to be assuming that he has to support adding/uploading videos from your CMS.
If your dev is going to use a 3rd party API like YouTube, 2 sounds reasonable. If you're going to serve it on your own site, it'd take at least a week's worth of programming to make sure your site can take such a heavy load of streaming data -- it's stupid, not to mention highly irresponsible, to assume it could be worked out in a day.
Now, if you're client is only really talking about embedding videos in blog entries or articles, that's a very trivial task: YouTube, Vimeo and other video sharing sites already supply the HTML embed code that's needed to display a video on a page. In fact that's a zero effort task assuming that your blog entry editor properly parses the embed code, or has an Edit HTML feature.
So, which one is which?
This might be a good occasion to use the <video> tags. It might simplify things at the cost of only supporting users with recent browsers.
Two days is a quite optimistic estimate for all that you've mentioned. Maybe for embedding YouTube videos only, but for upload/storage/streaming of videos on the local server it's a different thing entirely.
But if you don't understand programming yourself, then you have to trust the expert that you've hired to do the job for you, and you have to tell the client that is how long it will take. The fact is that these things aren't trivial to write, there's the front end website management interface that needs creating, and the back end server software that manages what to do with the uploaded file. Never mind integration and making sure it's easy for the client to run a workflow of upload file, incorporate that video inside some content in the CMS, and so on.
I just recently did this, you need to get videoLan http://www.videolan.org/
This streams mostly anything, after you set up a streaming site it's easy!

Resources