I'm reading a binary file. Apparently its older, and some of its values are based not on position, but on null terminated bytes.
Meaning...
Position 17 thru 35 represents a value, however, if their is a null byte at 30, then you get garbage if you try to read 17 thru 35 as a value...
I need to read, specifically, from 17 to 29 in this instance because pos 30 is a null byte.
Have to read...
User Profile
Collapse
-
Reading a null terminated byte
-
Hard to understand what you want...except that you are overdemanding in tone. -
Are you restricted to just using a text box? Why not use the right tool for the right job. Use a datepicker.
In any case, watching the keypress will be tough, and you have to think ahead. Which format will they enter the date? January 3rd, 2011? 1/3/11? 01/03/2011?
You can't easily restrict the key presses as they are all over the place with that. IMO, your best bet, short of using a date control, is to allow...Leave a comment:
-
For instance...
...Code:Dim factorCheck As Decimal = dr("FACTOR") Dim CalcType As Integer Dim qtyCheck As Boolean = dr("QTY_UNIT") = (txtitemunit1.Text) If qtyCheck = True Then 'By refactoring just a little, its clear that this must be true in all of your conditions. Select Case factorCheck Case 1000 CalcType = "FactorBy1000"Leave a comment:
-
First off...walk away from the horrible if elseif redundancy. Clean it up, and simplify.
Instead, step back and analyze the calcs done.
How many are there?
Can you break them into logical groupings?
Are they defined correctly?
(i.e. dr("RATE_UNIT" ) = (txtitemunit2.T ext)) = (dr("FACTOR") = 0.001)
This does not seem to make any sense to me. RATE_UNIT is a boolean value???...Leave a comment:
-
Here is the code you need instead.
The issue is specifically with the variables.
1. You need to give them the right values first, -before- you build the SQL string.
2. You SQL string did not break out the variables from the string properly.
When you pass a SQL string to be executed, it passes the entire string as it computes. If you don't break out your variables properly, in this...Leave a comment:
-
Ah...ok.
Create a class that takes the 68 byte buffer in as the parameter...mak es sense. Ok. Cool.
I'm so new to C#, that I think I got unnerved and used any command that seemed to even look remotely like it would give me an answer.
Why on earth did I think that base 64 to string would do for converting a binary to string??? LOL!
What would you use the .Read for then if it...Leave a comment:
-
Your request is a bit confusing.
You have a project that calls a series of datareports.
Are these datareports working?
If they are...then the datasource property of the datareport object contains the database.
Is there more to what you are asking?Leave a comment:
-
Small syntax issue.
CoreModules = DLookup("[Core Sem 1]", "Core Modules", "[Course Title] = Forms![Student]!Frame10")
It was the "&" that needed to be removed.Leave a comment:
-
Steps you need to take:
1. Create a Subroutine that uploads data to an online server. Checkout Chilkat software. Its a great resource for that for a modest price.
2. With that created, you can easily do the function you are looking passively.
Unfortunately, you're question is not that specific. Especially regarding the type of data, some sample code, or whatever. But if you have some resource (cash) to use,...Leave a comment:
-
First off...thank you for you efforts! You hit it spot on.
A few followup questions, though, if you (or others) don't mind.
1. So why didn't heroText = bufferedStream. Read(bytes, 16, 11) work?
Couldn't I take this and convert it?
2. Converting...I know that C# is has strong casting compared to VB. But where did I go wrong with the statement below. Did I mix this up? Would the convert statement...Leave a comment:
-
BlackLibrary started a topic Reading a binary file in 68K buffer, and extract/display just bytes 16-20in C SharpReading a binary file in 68K buffer, and extract/display just bytes 16-20
The title probably tells it all.
I'm a VB6 going to C# and trying to take a task I can do easily in VB6 and do it in C#.NET. I can really use some help and any pointers you can share.
Below is the code I've created so far to the job. Attached is the binary file in question so you can proof it for yourself.
Form has a multline textbox and a button event.
[code=c#]
private void button1_Click(o bject...
No activity results to display
Show More
Leave a comment: