How to read .lbl file

自闭症网瘾萝莉.ら 提交于 2019-12-04 06:02:17

问题


I want to read my .lbl file and store its data into a database column. So, whenever the user wants to modify it, they may create a new .lbl file from the Database.

I have converted my .lbl data into Binary by using the snippet shown below:

byte[] fileBytes = File.ReadAllBytes("D:\\Work\\PNS\\TEST.lbl");
StringBuilder sb = new StringBuilder();

foreach (byte b in fileBytes)
{
    sb.Append(Convert.ToString(b, 2).PadLeft(8, '0'));
    string bindata = sb.ToString();  // store this variable value in DataBase Column
}

File.WriteAllText("D:\\Work\\PNS\\TESTnew.lbl", sb.ToString());

But, When I Open a new file I get Error like this

Unable to open label, the file or folder is not accessible, does not exist, or is already opened by another user. Try Opening the label with 'read-only' flag set!

Kindly Help me to figure out this problem

来源:https://stackoverflow.com/questions/18606491/how-to-read-lbl-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!