Question : How do i determine the size of a byte array at run-time in c#?

Suppose I have the following lines of code that stores the current date and time as an array of bytes"

fileStream = new FileStream(applicationDataFile, FileMode.Append);
byte[] currentDateTime = System.Text.Encoding.ASCII.GetBytes(DateTime.Now.ToString());
fileStream.WriteByte(currentDateTime, 0, <# of bytes to write>);

How would I determine the size of this array so that i can plug it into the writebyte function of fileStream?

Answer : How do i determine the size of a byte array at run-time in c#?

Paul, please try this:

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
Sub BajanPaul()
Dim lastRow As Long, i As Long
Application.ScreenUpdating = False
lastRow = ActiveSheet.UsedRange.Rows.Count
For i = lastRow To 6 Step -1
    If Not IsNull(Rows(i).Text) And IsNull(Rows(i - 1).Text) And Not IsNull(Rows(i - 2).Text) And _
        Not IsNull(Rows(i - 3).Text) And Not IsNull(Rows(i - 4).Text) And Not IsNull(Rows(i - 5).Text) Then
                        Range(Rows(i - 5), Rows(i)).Delete
            i = i - 5
    End If
Next
Application.ScreenUpdating = True
End Sub
Random Solutions  
 
programming4us programming4us