المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : To Henry Minute, Original Griff, fly904, stancrm, Computafreak, Guffa, DaveyM69, J4am



C# Programming
05-26-2009, 10:40 PM
Rajdeep.NET (Thats me) wrote:
Hi pals,

I am trying to create a small utility which can block folders from direct access. For this purpose, I have a textbox in my form and a two buttons namely: browse and apply.

Now, whenever the user clicks on browse, the Open file dialog box appears and whatever folder has been selected by the user is displayed in the textbox.

Now, comes the major problem. In order to block the particular folder selected by the user, I have to generate two batch files (files with .bat extension) on the ******** of the folder, that has to be locked. Like if the folder to be blocked is in this 'C:\\myfolder\\subfolder\\lockfolder' ********, where lockfolder is the particular folder which I have to lock, then in that case, I have to generate a batch file in 'C:\\my folder\\subfolder\' that will lock the folder 'lockfolder'.

Any Idea how to do that..... please recommend.

Sorry for my poor english,
Cheers to you,
Rajdeep.NET

http://www.barakasoft.com/script/Forums/Images/smiley_sigh.gif http://www.barakasoft.com/script/Forums/Images/smiley_sigh.gif http://www.barakasoft.com/script/Forums/Images/smiley_sigh.gif
So many replies but all useless and hurtful...... I hope that you guys should had read the question properly before commenting. Some said, "Learn to google", while some said, "learn C#"!!! Someone even said that I was upto some malicious thing. What a DUMB thinking!!!! I wonder, how I could create a virus or any other malware stuff using .NET?! Wont the to be infected system require .NET framework to be installed already....before hand in order to make the .exe malware functioning? Or will my virus show "Invalid Win32 Application" || "The application failed to initialize properly"???!!!! http://www.barakasoft.com/script/Forums/Images/smiley_laugh.gif

Why comment when you are not at all capable for sorting out my problem or suggesting a comprehensive way to solve it (I dont mean that you directly handover a code to me, because I know that you wont be paid for writing codes for me) All sort of British Mumbo Jumbo prevails here, it seems. And I remember, even somebody said that all my postings were flagged RED!

Now, let me directly come to the point. Whats so funny about my question?! Some said that I have to use the StreamWriter method and yes, I am familiar to that ofcourse. I ain't idiot. Actually my way of posting the question was incorrect. Thats it. I am not a Graduate in English as you all are and neither is my mother tongue english.

So here I am once again to explain my problem more comprehensively:

I know that I have to use the StreamWriter method and create a text file, where I'll enter the required execution parametres and then convert it to .bat using the File.Move() method. But thats not the problem at all actually.

I have to get the folder path using the DirectoryInfo[] method. But how will I generate a batch file (txt file renamed as .bat executable) in the ******** where the folder is saved?

Thats my question.....


Cheers,
Rajdeep.NEThttp://www.barakasoft.com/script/Forums/Images/smiley_mad.gif