Byte is an immutable value type that represents unsigned integers with values that range from 0 to 255 . Here we open a FileStream class instance and using the method Write() . Write() method writes a block of bytes to the current stream using data read from buffer.
oFileStream.Write(byteData, 0, byteData.Length)
FULL CODE : Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim str As String = "https://www.hungvb.com"
Dim encod As New System.Text.UTF8Encoding
Dim byteData() As Byte = encod.GetBytes(str)
Dim oFileStream As System.IO.FileStream
oFileStream = New System.IO.FileStream("c:\bytes.txt", System.IO.FileMode.Create)
oFileStream.Write(byteData, 0, byteData.Length)
oFileStream.Close()
End Sub
End Class
Good luck.
Hướng dẫn bình luận
Mọi người để lại bình luận góp ý, nhận xét về những bài viết mà mình chia sẽ văn minh lịch sự hay kích động, Không spam, không chèn link quảng cáo, bán hàng, Không sử dụng từ ngữ thô tục, xúc phạm, kích động, Link chỉ được phép khi thực sự liên quan đến nội dung bài viết, Không mạo danh người khác hoặc sử dụng email giả, Bình luận vi phạm sẽ bị xóa không cần thông báo trước.Mọi người lưu ý răng, nếu muốn chia sẽ code ở bình luần thì cần mã hóa code trước khi bỏ vào khung nhé. :)
⑴ Chèn ℂ𝕤𝕤 theo mẫu :
[pre css] CSS [/pre]⑵ Chèn ℍ𝕥𝕞𝕝 theo mẫu :
[pre html] HTML [/pre]⑶ Chèn 𝕁𝕒𝕧𝕒𝕤𝕔𝕣𝕚𝕡𝕥 theo mẫu :
[pre js] Javascript [/pre]🖼️ Chèn 𝕀𝕞𝕒𝕘𝕖 theo mẫu :
[img] Link hình ảnh [/img]🎞️ Chèn Video 𝕐𝕠𝕦𝕥𝕦𝕓𝕖 theo mẫu :
[youtube] Link Youtube [/youtube]1 Nhận xét
(y)
Trả lờiXóa