Work With Hex Bytes And Chars Like In C++?

Oct 11, 2010

Well my question is simple and straightforward. Is there any way we can use hex values like in c++?

I am going to write binary files, but for that i will have to define certain characters like this for example.

x00x00x11x22x33x00x00. I would first need to convert stuff like this to a byte array, and then write it to a binary text file.

View 2 Replies


ADVERTISEMENT

Filestream Reads Bytes - How To Read Chars

Mar 24, 2010

I have successfully gotten the filestream function to read a text file and return bytes. I want it to return letters, not bytes, using random access.

View 4 Replies

.net - Regex Replacing Non-words Chars In Strings, Ignoring Specific Chars?

Oct 8, 2011

In VB.net I've got the following line that removes all non-alphanumeric chars from a string:

return Regex.Replace(build, "[W]", "")

I now need to extend this to remove non-alphanumeric chars that aren't [] or _. I've changed the line to:

return Regex.Replace(build, "[W[]_]", "")

However I'm pretty sure that this says

replace non-word or [ or ] or _

how do I negate the tests for the [] and _ chars so that it says

replace non-word and not [ and not ] and not _

Some examples:

"[Foo Bar_123456]" => "[FooBar_123456]"
"[Foo Bar_123-456*]" => "[FooBar_123456]"

View 2 Replies

.net - Cast A List Object Of Chars In An Array Of Chars?

Nov 20, 2010

How to convert or make a cast of a List object typized as a container of chars like

Dim mylist As List(Of Char) = New List(Of Char)(New Char() {"1"c, "2"c})

in a simple array of chars as

Dim mychars() As Char

without make a loop for...

View 1 Replies

RijnDael Encryption/decryption - Select The Key Bytes And The Block Bytes From The Numeric Up/down?

Nov 13, 2010

I want it to do is that you input a string, then you select an algorithm (Theres only going to be one RijnDael) then you input a key, then the Initialization Vector comes from "txtIV.text" then you select the key bytes and the block bytes from the numeric up/down, then you either encrypt or decrypt.

View 1 Replies

Generic Restriction - Dont Select The Key Bytes And The Block Bytes From The Numeric Up/down?

Sep 16, 2011

Ok i am having some issues designing a base-class to handle generics.Caveat is i need to restrict the type put in as a Numeric type, specifically Int16, Int32, or Int64 (Short or Long).I know you can do Of T as {Structure} but i dont want to select the key bytes and the block bytes from the numeric up/down.

View 2 Replies

Bytes Written Exceed The Content-Length Bytes In XML Post?

Feb 19, 2011

I keep getting a ProtocolViolationException "Bytes to be written to the stream exceed the Content-Length bytes size specified." on the following code.I've tried setting Content-Length numerous ways with no success.

Dim url = "https://domain.com"
Dim req As WebRequest = WebRequest.Create(url)
req.Method = "POST"
req.ContentType = "application/xml"

[Code]...

View 1 Replies

VS 2008 What Does This Line Exactly Do - I = Stream.Read(bytes, 0, Bytes.Length)

Dec 28, 2010

What exactly does this line do?

i = stream.Read(bytes, 0, bytes.Length)

Does it read the entire message string sent by the client? I have a line to write to the stream later in the code and that does not seem to be sending anything back to the client, although the code around is excuting.

i = stream.Read(bytes, 0, bytes.Length)
While (i <> 0)
Try
' Translate data bytes to a ASCII string.

[code].....

View 3 Replies

Read 2 Bytes Out Of 4 Bytes From A Text File?

Sep 22, 2011

I created a text file contains 4 bytes of data

AABBCCDD

I just want to read the first 2 bytes (AABB) to execute it with my program.

Then I'll need to read the last 2 bytes (CCDD) for another computer routines

View 3 Replies

Display KB Not Bytes 391 KB (401303 Bytes)

Aug 2, 2009

Probably missing something silly here, Her eis what my display looks like Sending image...(401303) I would prefer it displays as Sending image...(391 kb)

[Code]...

View 7 Replies

.net - How To Allow Only A-Za-z Chars

Jun 10, 2012

I tried below code:

Private Sub txtName_KeyPress(sender As Object, e As System.Windows.Forms.KeyPressEventArgs) Handles txtName.KeyPress
' allow upper and lower case A-Z, and backspace

[Code]....

But it gives:

'KeyAscii' is not declared. It may be inaccessible due to its protection level.

how to allow alphabet only ?

View 4 Replies

Get Certain Chars In String?

Apr 4, 2011

I am making an antivirus program and i am having a problem with my database. how can i only get the hash in this string:

693248:ff807bd383d377f7f8f91ed4aa7677ae:Trojan.Agent-178374

i only want between the two ":"s in this string. how is this possible? and also how do i get the last part on the right of the last ":"?

View 3 Replies

Keyboard Chars

May 16, 2009

ok here is the situation. i have a form that is hidden. the form needs to wait until somone hits the F2 button.

View 1 Replies

.net SqlBulkCopy With Unicode Chars

Nov 29, 2010

i have a csv file that needs to be imported to sql server the file includes Unicode characters, so i saved it in notepad as Unicode now when i run this in sql it works excellent BULK INSERT personimps FROM 'C:MyImp.csv' WITH (FIELDTERMINATOR = ',',datafiletype='widechar')but when using the following in my code-behind in asp.net, i get gibberish where the Unicode chars should be. [code] it seems like the oledbconnection is ignoring the extended properties, or maybe i didn't set up the connection-string correctly? the ASCII chars come out OK, the Unicode fields are just gibberish.

View 1 Replies

Property 'Chars' Is 'ReadOnly'?

Jul 10, 2009

THis is a line of code i have, it's a code to go at the bottom of a document and the title of the question is the error it has, how do i change the 'Chars' to not be read only? I can only guess 'Chars' is a character.

pagecode(1) ="01274-6759q-DDD"

If you're not living on the edge, you're taking up too much room

View 1 Replies

ReadProcessMemory Returning Only 4 Chars?

Apr 12, 2009

let me show you my code first and then explain my problem.

[Code]...

View 2 Replies

Remove Chars From String End?

Oct 29, 2009

I'm data binding to a label in a grid and need to knock off the last two chars, not so easy as I thought.I know this is wrong it just shows how I'm coding:

Code:Private Sub TemplateControl_DataBinding_Label(ByVal sender As Object, ByVal e As System.EventArgs)

[code].....

View 4 Replies

Replace The Enter Key With An Other Set Of Chars?

May 11, 2009

How can i replace the enter key with an other set of chars

example - text.replace(" ", "this is a space")

that previous statement will replace all spaces with the string "this is a space"

how do i do this for an enter?

View 1 Replies

WebBrowser - Allow Chars In Textbox

Mar 11, 2010

Well I made another thread but I know how to make textbox allowed chars but is possible with web browsers? Like if f1 - f12 is pressed then nothing happen like nothing have been touch.

View 1 Replies

C# - How To Write Unicode Chars To Console

Apr 21, 2011

I was wondering if it was possible, in a console application, to write characters like "℃" using .NET? When I try to write this character, the console outputs a question mark.

View 2 Replies

C# :: Let Only Some Chars Be Typed In A Datagridview Cell?

Apr 16, 2011

Is there a way to let only certain chars be added to a datagridview cell? like '1234567890'?

View 1 Replies

Create Strings From 2d Array Of Chars

Feb 22, 2011

I have a 2d array of chars and i need to start at (0,0) and creat a string and check it against some value then still then add another char to the first one and check it. I need to do that in every direction.[code]say im at the H their are like 8 way i need to check..

View 1 Replies

Enter A Certain Number Of Chars Into A Textbox?

Nov 30, 2010

It seems like I'm only able to enter a certain number of chars into a textbox.Like if I have a list from 1 to 10000.When I paste it in a textbox it ends like this:

5639
5640
5641

[code]....

Why cant I add everything to the textbox?

View 9 Replies

Get The Error Property 'Chars' Is 'ReadOnly'

Dec 17, 2011

I get the Error Property 'Chars' is 'ReadOnly'

View 3 Replies

Lose Last 3 Chars From String Variable

Mar 25, 2010

if the last 4 chars in my string(result) are " AND" or the last three chars are " OR" I would like to remove these from the string. So far I have am trying result.trimend and a few other methods but am unsure how to get it working.

View 3 Replies

Masked Text Box - Get Rid Of Extra Chars

Jul 7, 2010

I am using a masked text box to format phone numbers. However, I do not want the extra formatting that gets insterted from the masked text box: (800)-555-1212

All I want is: 8005551212

But I still want the user to type it in like this (to make it easier for user):
(800)-555-1212

I am thinking I can run a replace function on it, but I am not sure what event to use. I found a number of tutorials, but not that useful for what I am doing. [URL]

View 1 Replies

Parameterized Query And Special Chars

Nov 8, 2010

I solved this issue in this thread but there still are issues with special chars. ie 'I thought by doing parameters that it would take care of any special chars for you. Well i am still getting mysql exceptions about syntax. I look at the string it is working with and it has a "'" in it.Why are they not working as I expect them to?

View 7 Replies

Prevent User From Using Certain Chars In Textbox

Apr 29, 2010

I have a Textbox in which the user types in a name for a folder to be created. However, Windows does not allow the followin chars:

[Code]...

View 12 Replies

Read Chars From File To Array

Feb 19, 2011

The file I need to read in is a square 8x8 or NxN. the chars are separated by spaces and at the end of the line I believe a crlf. When I try to read in the file i get the crlf's when i use this [Code]

View 1 Replies

Removing Text Between Chars From A String

Apr 14, 2010

this is driving me crazy , I have a string like this dim s as string = "<a href="url.aspx? target=_BLANK>mik, H</a>" I want to remove "mik, h" from the string, how can i do that?

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved