Latest Project: Sour & Sweet Experience!
Current Mood:
Esctatic
The latest project that has been consuming my nights (and mostly ALL of my free time) caused a lot of “Sour” experience…. followed by the long awaited “Sweet” one
Some Background:
I am working on a personal project that will “automate” the task of downloading files from RapidShare. Sure, RapidShare hosts a lot of “illegal” files, however, how my software will be used, is not my concern. The best I can do, is let the end-user know, that whatever they use my software for, it will be their responsibility. That being said, my RapidShare download client, code named: “RapidRush” (go figure!), is now soon to be in Beta stage (after experiencing some major frustrations!!).
The Error:
The error that kept coming up was: “Access to the path C:/PATH/ was denied”. I looked and looked, researched my brains out, and finally realized my stupid mistake…
The Stupid Mistake:
I was saving the file without the filename!… i.e., I was saving the file using the following line:
strLocal = new FileStream(tbSaveTo.Text, FileMode.Create, FileAccess.Write, FileShare.None);
So, let’s say the tbSaveTo.Text = “C:/MyPath”
However, the correct input parameter for FileStream INCLUDES a filename as well…
Therefore, the correct first parameter to FileStream had to be something like this:
tbSaveTo.Text = “C:/MyPath/FILENAME.EXT”
The Solution:
strLocal = new FileStream(saveToDir + "\\" + fileName, FileMode.Create, FileAccess.Write, FileShare.None);
Final Word:
Check out CodingRush, within the next couple of days, to get your hands on the first beta! I plan on releasing FULL source-code to this project, as well.
-RushiKumar