Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

[VB.NET] Help with changing file extension

I need help to make a code which gets the file extension from a specific path, and then changes it to a new file extension. For example from .txt to .pdf. The file extension can be random, so the code has to find out what the extension is.
Have a look at the Path.ChangeExtension(String, String) and File.Move(String, String) methods. Combined they do exactly what you need.
https://github.com/Washi1337

"I'll tell you this UDP joke, and I don't care if you will get it or not."
Here's all you have to know, although your threads are very fucking sketchy so I won't give you any code.

Path.GetExtension
Path.GetFileNameWithoutExtension
Path.GetDirectoryName
System.IO.File.Move
System.IO.File.Delete

Alternatively you can use ChangeExtension as said by Washi but I never tried it before so constructing the path based on the first 3 methods is what I recommend.
Do not spoon feed this one, he's up to no good lads. (check his threads, you'll see what i mean)
In c# you can simply rename the file .

string fileName = Path.GetFileName(path);
string ext = Path.GetExtension(path);
string newFileName = fileName + Reverse(ext);

File.move(path,newFileName);
Should be closed and not banned
His thread were literally:
How to spread
How to encrypt files
How to changeextension.
For sure not ransomware


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by MarwenSep 24, 2022 04:19 PM 10 638 Sep 24, 2022 04:19 PM
Last Post: BinaryFox
[Python] by Lukos1234Aug 31, 2017 02:21 AM 22 862 Aug 31, 2017 02:21 AM
Last Post: vorticalbox
[Python] by ilikepythonDec 16, 2015 03:15 AM 4 149 Dec 16, 2015 03:15 AM
Last Post: Pseudonym