Jump to content

Remover duas casas decimais


Recommended Posts

vikcchm, Obrigado

Testei na leitura de um ficheiro TXT com um valor e funcionou.

Agora queria usar o mesmo código para ler uns numero de um Ficheiro Binário, e não funcionou.

Aqui neste código:

 For Each drive As DriveInfo In DriveInfo.GetDrives()
		Dim FILE_NAME As String = String.Format("D:\DADOS", drive.Name)
		If System.IO.File.Exists(FILE_NAME) = True Then
			Dim data() As Byte = File.ReadAllBytes(FILE_NAME)
			Dim palavras As New List(Of String)
			Dim palavra As String = ""
			For Each b As Byte In data
				If b = 0 Then
					palavras.Add(palavra.Replace("N", ""))
					palavra = ""

				ElseIf b >= 32 Then
					palavra = palavra + Chr(b)
				End If

			   palavras(5) = TextBox7.Text
			palavras(7) = TextBox8.Text

			encontrou = True
			Exit For
		End If
	If Not encontrou Then
		MsgBox("Ficheiro não Existe")
	End If  

Alguém para dar uma ajudinha?

Edited by a3deluxe
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.