Results 1 to 8 of 8

Thread: custom file type questions

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2005
    Location
    Indiana
    Posts
    451

    Question custom file type questions

    Hello,

    I am working on learning about how to make custom file types. I have learned how to register them, and about serializing into a file. I have also created an encrypted file with my own extension that just stores text. However, I have been looking around Google, and here to see if I can find more information about building a custom file type. Not just a text file with a renamed extension. I would like to store information about a report in a file that cannot be read using notepad. Does anyone know of any good tutorials or things online that would give me some in-depth information? If nothing on line, any books that could be recommended would be great, too. I prefer online to start, but if there is a specialized book for just that subject, that would be a good long run tool.

    I am currently using Visual Basic 2003, but will be getting 2005 ASAP, so if there is anything that would work for both, that would be great, else 2003 info would be good for now.

    Thank you for your help.

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: custom file type questions

    why not just encrypt the text when its written to the custom file type, and decrypt it when reading it into your application. The .NET framework has a bunch of really good crypography classes built right in. use a symmetrical one like TripleDES so that the value can be encrypted and decrypted using the same key pair.

    I use this to store information that I wouldn't want to be human readable by opening the file in notepad.

    Other than that, I suppose you could write a binary file?

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2005
    Location
    Indiana
    Posts
    451

    Re: custom file type questions

    Yah, I have saved text to an encrypted file using DES. I guess I was just looking for a more advanced file structure. I saved a serialized class, but when I opened it, the text was readable.

    Is it possible to serialize and encrypt a class for saving? I tried to see how to do it, but I couldn't see how to go about doing both.

    Also, if I do both, can I still use it in remoting?

    Basically, I am looking for ways to take a report that can be created in my software, and save it to a drive so that it can be sent in email so another user of my software can open it, plus be saved in a database (as a class), which could be on a local drive, or on a server. I hope I said that clearly.

    Thank you for your help.

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2005
    Location
    Indiana
    Posts
    451

    Re: custom file type questions

    bump

  5. #5
    Lively Member
    Join Date
    Mar 2006
    Posts
    74

    Re: custom file type questions

    Have you found a soltution for this? i'm trying to do the same thing with now luck. I can create the "custom file extension" by saving a text file with a different extension, but it is still possible to open and read that file with notepad.
    I want the file to only be read and with my app.

  6. #6
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: custom file type questions

    then you should do the same exact thing I suggested above.

    Encrypt the text when you write it to file. Decrypt the text when you read it from the file.

    Since your app is the only one that will know how the encryption/decryption is done, opening it up in notepad will be useless, they will only see garbage.

    Now is this 100% secure and uncrackable, of course not, but if you just want to use a decent encryption to scramble the text, this method works just fine.

  7. #7
    Lively Member
    Join Date
    Mar 2006
    Posts
    74

    Re: custom file type questions

    Ok sorry i miss read your previous post. Can you tell where i can find more info on encryption then? I'm using VB 2005 (express)
    Thank for your help

  8. #8
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: custom file type questions

    You can check the MSDN documentation, or search around the web for some examples.

    I actually had posted just yesterday a complete tripleDES class for doing encryption/decryption of text or bytes.

    It can be found here
    http://www.vbforums.com/showthread.php?t=447415

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width