[Help]File Conversions

Posts 1–8 of 8 · Page 1 of 1
[Help]File Conversions
I've seen many file converters in vb and I've reflected them but can't seem to figure it out.

If anyone would like to explain it to me, I'm sure the vb section would love a tut on it
There are a few, It depends on the conversion, explain what your looking for exactly, and what files you are looking to convert...etc..

See what we can do from there
I guess he want´s to make something with Combat Arms Rez files :P
well in my updater, i need to change all the exes uploded to ".txt" (it will deny access to them if it is .exe) and when they are downloaded by the program changed back to ".exe"

if this is what your looking for then heres the code:
Code:
FileList = My.Computer.FileSystem.GetFiles("PathOfFile", FileIO.SearchOption.SearchTopLevelOnly, "*.txt")
'Iterate the list of files
For Each File In FileList
'Make a copy of the new file name
ToFile = File.Replace(".txt", ".doc")
'Rename the file
My.Computer.FileSystem.RenameFile(File, ToFile)
'Move on to the next file.
Next
Quote Originally Posted by mnpeepno2 View Post
well in my updater, i need to change all the exes uploded to ".txt" (it will deny access to them if it is .exe) and when they are downloaded by the program changed back to ".exe"

if this is what your looking for then heres the code:
Code:
FileList = My.Computer.FileSystem.GetFiles("PathOfFile", FileIO.SearchOption.SearchTopLevelOnly, "*.txt")
'Iterate the list of files
For Each File In FileList
'Make a copy of the new file name
ToFile = File.Replace(".txt", ".doc")
'Rename the file
My.Computer.FileSystem.RenameFile(File, ToFile)
'Move on to the next file.
Next
If hejsan1 is right, then it's not complicated, but it depends on the conversion itself,
renaming does not equal conversion

Example:
PDF to Tiff

The file cannot just be ranamed .tiff , it needs to be treated as a binary file and actually converted.

VB.net allows data conversions using implicitly (Automatic Conversion) and explicitly (Manual Conversion).

In order to do a real conversion , You will need to understand how to use the types of conversion , You need to understand Data Conversion in order to properly convert file extensions.
Quote Originally Posted by NextGen1 View Post
If hejsan1 is right, then it's not complicated, but it depends on the conversion itself,
renaming does not equal conversion

Example:
PDF to Tiff

The file cannot just be ranamed .tiff , it needs to be treated as a binary file and actually converted
You can "rename" a image file like from .jpg to .gif and it works, but if you going to actually "convert" you need alot more code and so.
Jpeg to Gif, Depends on the compression, If you create a Gif and rename it .png and this gif was compressed and created with PShop, then there is a good chance it will error unless renamed back to gif. etc.

PDF to Tiff will never happen properly

Again, it depends on the conversion. Which is why I require more information on what type of conversion.

In the mean time I will work on a Intermediate Data Conversion Tutorial
Thanks guys, I'm looking for more advanced stuff, not just renaming the files

and yes I am looking at this for combat arms rez file related stuff, I'm actually in contact with the guy who made LTB2X
Posts 1–8 of 8 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us