You still haven't explained your projects general purpose. Many of your threads constitute potential malware or other type of malicious bits and pieces, and people put pieces of a puzzle together.
Furthermore, you've shown no effort to learn the language or at least the basics before you begin posting, most of the stuff you ask is covered in the MSDN documentation as extremely basic tasks, so it's apparent you haven't began searching the most common place for answers, nevermind extensive (or some would consider basic) searching of crawling through google.
I still ask, what is the general purpose of your application, what does it do and why is it doing it? Why are you hiding console applications, copying applications and locking folders. What is the purpose?
For your kind information, I am upto no malicious stuff. Rather, I am focusing all my attention towards the security angle, imlementing .NET. I need to block folders for security purposes and not for heuristic ones. If it would had been for me, then I would have never consulted you guys, since I am doing it by using a simple batch trick which I already posted as a reply to Dave Kreskowiak....
But this is for users, not just for me or you. Yeah I agree that replicating files and hiding console applications sounds malicious but I am just trying to test my software. Its almost done but, the only problem I am facing is in the question.
I need to hide my console application, because it will take a lot of time to process and so I only wanted to avoid the console window for the users. Thats all....
Otherwise, I am not going for anything like the dotnut or the sharpie virus because I am just 16 now. And I am trying to focus entirely on development else huer.
My answer was not intended to be hurtful; if you took it that way then I apologise. I didn't realise that posting the name of a class would be offensive. However, you received the answer to the precise question you asked, which was (in my eyes): how do I save a .bat file to a given location? Anyway, to the point at hand:
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
Just to point out, the path of the file you pass to the StreamWriter constructor doesn't have have to be a text file. You could create "FilePath.bat" in situ, which would eliminate the need for File.Move
This also goes a long way towards answering your full question. If you have the folder path from a DirectoryInfo instantiation, then passing this path to the StreamWriter(string) constructor will create the file in the given location. If you want the parent directory, then Path.GetDirectoryName can be used
Incidentally, the phrase "location where the folder is saved" isn't strictly accurate. For the sake of learning, you could have typed "the folder's parent directory"
I try to be helpful, and what do I get for that? You call it useless and hurtful. I can understand if you don't find the advice very helpful if it's not exactly what you are looking for, but it's certainly not useless. If you find it hurtful, then it's certainly not my fault, and something that you have to work on yourself. If you can't even read well meaning advice without being hurt, you should definitely not be asking questions in a forum, but rather seek professional help.
Despite everything, the person most likely to be fooling you next is yourself.
Haven't you noticed a pattern yet? He writes these sob story posts after he receives answers he doesn't like! This is the second time. When does it get old? He posts absolute beginner-level posts, gets told to learn before he posts a few times, then he writes a sob story on how he's just trying to learn and English isn't his first language etc etc. All to start over the cycle of hand-holding for another 10 posts before he throws out another thread like the OP.
Answer the question I asked before with a justifiable answer (that doesn't include reasons why a 'malicious' app in .net could be unsucessful) an I'll help you all I can, whenever I can, just like everyone else on CodeProject.
Until then, I'm not prepared to help you any further I'm afraid as the things you've been asking are suspicious - even more so when combined.
Dave BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
* Save the text file as key.bat in the same drive.
* To lock the pics folder, simply click the loc.bat and it will transform into control panel icon which is inaccessible.
* To unlock the folder click the key.bat file. Thus the folder will be unlocked and the contents are accessible.
Thats is what I want to do using C#.NET and nothing malicious in it, I guess. I swear I am upto no malicious thing. I cant make things to be understand properly because I am poor in english and that turns to be malicious, I dont know why!?
Can you suggest me any such route via which I can access the folder? I thought that it was blocked while it transformed into the control panel icon and if tried to access it, it would navigate to the Control panel.
That only fools Explorer. It doesn't do anything to stop someone from using their own version of Explorer, and better yet, doesn't stop anyone from using the CMD prompt to get into the folder and renaming it back to normal.
Again, you're lack of understanding of Windows, Windows Security and NTFS is glaringly obvious.
Normally I don't offer advice to people, but I think you need some help with your people skills here. Over a period of time, you've managed to arouse the suspicions of the regulars in the forum, and you've posted questions that show a lack of understanding about .NET, hence the reason that you have been advised to purchase books on C#.
You may want to stop using this identity, create a new user and use that to post in future. Before you do this though, stop and think about why people have been talking like this to you. These guys are good guys, and they give a lot of advice in the forums. It may be time for you to face the fact that the problem isn't them, but you. Yes, English isn't your first language but it's the same for a lot of the others who post here, many of whom successfully get answers to their problems.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith
As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
PS: Advice is the only thing that can be given to anyone free of cost!
Apparently, advice is not the only thing that is given free of cost here. As a matter of fact, we give professional guidance, suggestions, source code, etc,. and that's FREE OF COST. Not to mention the articles. You just need to take your head out that dark hole to see it. You also need to relaise that you have made yourself the butt of a joke here and you cannot blame anyone else for that.
And the advice you were talking about, came from a man whose development experience is more than my age. If I were you, I would have taken his advice very seriously instead of mocking him or posting meaningless stuff any further.
With millions of members and literally hundreds of queries solved across several boards each and every day here, if *you* have a problem, then *you* need an attitude adjustment, not anyone else.
It is a crappy thing, but it's life -^Carlo Pallini
I'd seriously think about taking Pete's advice, your list includes some of the most helpful and knowledgable people on the forum. Oh and the most persistent, I gave up on you weeks ago. You need to step back, evaluate your position and make some adjustments to your attitude, it stinks.
I think you will find a great lack of sympathy on this site from here on!
Never underestimate the power of human stupidity