开发者

Set File header of ".txt" file in .Net

开发者 https://www.devze.com 2023-01-03 01:21 出处:网络
Is it possible to store some special 开发者_JAVA百科content inside file header of \".txt\" file using .Net ? If yes how ? Please give me a sample code.No, this is not possible. .txt files don\'t have

Is it possible to store some special 开发者_JAVA百科content inside file header of ".txt" file using .Net ? If yes how ? Please give me a sample code.


No, this is not possible. .txt files don't have a header. They are plain (text) files without any additional file structure.

If you need to attach additional information to a .txt file you might want to have a look at Alternate Data Streams which are available when you are using NTFS. However, alternate data streams are a feature of NTFS only and will not survive a file transfer via another medium beyond a simple file copy (web streaming, sending by email, etc).

As your question is tagged with encryption it looks as if you are trying to store additional encryption information or a digital signature with your .txt file. In such a case it might as well be an option for you to have a look at container formats such as zip.

0

精彩评论

暂无评论...
验证码 换一张
取 消