如何将字符串转换为二进制代码以构建文件?
在数据库中保存了一个二进制代码(这是一个 *.jar) 我需要下载此代码(使用选择查询)并重建此文件
从字符串转换为文件的设置是什么?
有人告诉我我需要将其转换为数组字节,但我不知道如何将字符串转换为数组字节...最好的步骤是什么?
这段代码返回给我一个表
Public Function ConseguirCatalogo() As DataTable
Return conn.RegresarTabla("select archivo from catalogo where id= (select id from periodos where actual=1)")
End Function
,这段代码我得到了 String
Private Sub EnviarArchivo() 'para el Catalogo
Dim MyTable As DataTable = consultas.ConseguirCatalogo()
Dim binarycode As String = MyTable.Rows(0)(0).ToString()
End Sub
现在最终将其转换为文件的下一个设置是什么? (它是一个 *.jar)
well in a database is saved a binary code (this is a *.jar)
i need to download this code (with a select query) and Rebuild this file
What are the setps for convert since a String to a File?
someone told me i need convert it to array byte, but i dont know how to convert a String to a array byte... what are the best steps?
this code return me a table
Public Function ConseguirCatalogo() As DataTable
Return conn.RegresarTabla("select archivo from catalogo where id= (select id from periodos where actual=1)")
End Function
and this code i get the String
Private Sub EnviarArchivo() 'para el catalogo
Dim MyTable As DataTable = consultas.ConseguirCatalogo()
Dim binarycode As String = MyTable.Rows(0)(0).ToString()
End Sub
now what are the next setp for convert it finally to a file? ( it is a *.jar)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您将数据转换为字符串时,它就已经被破坏了。您应该直接以字节数组形式获取数据:
When you have converted the data into a string, it's already ruined. You should get the data as a byte array directly: