.NET 程序?qū)懗赡氵@樣也算厲害了,好好看看下面的代碼
成都創(chuàng)新互聯(lián)公司自2013年起,先為橫縣等服務(wù)建站,橫縣等地企業(yè),進(jìn)行企業(yè)商務(wù)咨詢服務(wù)。為橫縣企業(yè)網(wǎng)站制作PC+手機(jī)+微官網(wǎng)三網(wǎng)同步一站式服務(wù)解決您的所有建站問題。
Sub Main()
Console.WriteLine("請輸入一個二進(jìn)制數(shù)")
Console.WriteLine(bin2int(Console.ReadLine()))
Console.ReadKey()
End Sub
Function bin2int(ByVal bin As String) As Integer
Dim i As Long
For i = 1 To bin.Length
bin2int = bin2int * 2 + Val(Mid(bin, i, 1))
Next i
End Function
Dim Adoact As New ADODB Recordset ACCESS 數(shù)據(jù)庫的ST表
Dim i As Integer
AdoRst Open ST DRIVER={MySQL ODBC Driver};SERVER= ;DATABASE=mydb;;USER=root;PASSWORD=********;OPTION= ; adOpenStatic adLockOptimistic
Adoact Open st Provider=Microsoft Jet OLEDB ;Data Source=C:ks mdb;Persist Security Info=False
Dim tt() As Byte
Dim ss() As Byte
tt = adoact Fields( ) Value
ss = adoact Fields( ) Value
AdoRst AddNew
AdoRst Fields( ) Value = i
AdoRst Fields( ) Value = tt
AdoRst Fields( ) Value = ss
AdoRst Update
文本方式查看只有幾個字符
進(jìn)制方式查看
lishixinzhi/Article/program/net/201311/13595
首先引入System.IO命名空間
Imports System.IO
然后使用文件流來讀入數(shù)組:
Dim bytes() As Byte
Using fs As New FileStream(文件路徑,FileMode.Open)
ReDim bytes(fs.Length-1)
fs.Read(bytes,0,fs.Length)
fs.Close()
End Using
這樣bytes就是整個文件的所有字節(jié)了
從字節(jié)生成Image:
Dim img As Image = Image.FromStream(New MemoryStream(bytes))
img就是圖片了