I working with some EBCDIC data that I need to parse and find some Hex values. The problem that I'm having is that it appears that I'm reading the file in with the incorrect encoding. I can see that my record begins with "!" (which is a x5A in EBCDIC) but when doing the conversion to hex it returns as a x21, which is the ASCII value for a "!".
I was hoping that there was a built-in method in the framework, but I'm afraid that I'm going to have to create a custom class to correctly map the EBCDIC character set.
Using fileInStream As New FileStream(inputFile, FileMode.Open, FileAccess.Read)
Using bufferedInStream As New BufferedStream(fileInStream)
Using reader As New StreamReader(bufferedInStream, Encoding.GetEncoding(37))
I have split a string into a char array, now i need to copy the char array to an int array with the ASCII values of each char.Don´t know how to do it without looping each value.
This is my code:
origen = RichTextBox1.Text.ToString Dim valor As Char() = origen.ToCharArray Dim numeros As Integer() = (How can i convert "valor" to an int array?????)
how to convert system.string to char for label text?? Here it my
[Code].....
I need to get the strings from the site and input the fields strings in the label text, so I needs to convert char of system.string but i don't know how to fix it.
I can't seem to find how to recast a char to Ascii, the VB6 way was to ASC(thechar/thestring).What is the new method? or how to perform the recast while converting to a byte so it will fit and not buffer overrun.
[code] Error4'Char' values cannot be converted to 'Short'. Use 'Microsoft.VisualBasic.AscW' to interpret a character as a Unicode value or 'Microsoft. VisualBasic.Val' to interpret it as a digit.
I need to test a string of text that needs to contain a certain type of char values. The known is allowing of a-z,A-Z,0-9. But the variable (which will be coming from a database field) will be the allowed symbols. The allowed symbols will look something like:!@#$%^&*()
So using regex, how can I check a string of text to make sure it ONLY contains a-z,A-Z,0-9 AND the allowed symbols as shown above? Remember, the allowed symbols is dynamic at run time so I need to somehow be able to plug that in to the method at run time.
The following examples would be valid using the above symbol string:
Test1234% Test1234
The following example would NOT be valid:Test1234%_
I've been trying to figure this out for hours now, and I've given up on trying to solve it myself. Basically what I need to do, is convert a "double octet" binary string, such as "11010011 01011101", into a byte or char type if possible.I use the following code to convert my Unicode text into binary:
Private Function ByteToStr(ByVal bt() As Byte) As String Dim st As New StringBuilder For Each byt As Byte In bt
[code]....
But that gives me weird results. The "Convert.FromBase64String" obviously isn't what I'm after. Any help would be great. If I can convert the "binary string" into a bytes or chars I can get it into a string.
i have a form with 12 text boxes. I'm trying to get the data from those text boxes to "save", and when that form is opened again have the data be inserted back. This form has different time slots so I need to be able to have it save and repopulate based on what time slot I am clicking on. I was going to have it read the data by splitting it with commas, then inserting them back into the correct fields but it's not working. I had it write the results to a text file and they get written correctly and inserted back, but the problem with that is it only reads that text file so every time slot I open up gets the same data. Below is code I used to get the data when the Save button is clicked. [Code]
Problem is I get an error saying "Char values cannot be converted to Integers" on the first line, the (","c) part. Plus even then I don't know if this would do what I want. EDIT: Ok I fixed the error and got it kind of working, but now I have a new question. Now, I put a button on the form that I can use to load the data when I choose to just to test. This works, it takes the data from each time slot and loads it back when I click the button. New question is how can I get it to load as soon as I open the existing appointment? Putting it in the form load event won't work because it checks for data before there is any in there.
I've been trying to figure this out for hours now, and I've given up on trying to solve it myself. Basically what I need to do, is convert a "double octet" binary string, such as "11010011 01011101", into a byte or char type if possible. I use the following code to convert my Unicode text into binary:
I have a form with 12 text boxes. I'm trying to get the data from those text boxes to "save", and when that form is opened again have the data be inserted back. This form has different time slots so I need to be able to have it save and repopulate based on what time slot I am clicking on. I was going to have it read the data by splitting it with commas, then inserting them back into the correct fields but it's not working. I had it write the results to a text file and they get written correctly and inserted back, but the problem with that is it only reads that text file so every time slot I open up gets the same data.
Below is code I used to get the data when the Save button is clicked. [Code]. Problem is I get an error saying "Char values cannot be converted to Integers" on the first line, the (","c) part.
i want to read a character 1 by 1 from a string and a .txt, i know all about stream reader so for the .txt would it be somthing like:textbox1.text = tr.readCharacter.i would prefer to be able to read from a textbox or String array though.
I need validation for string to comply with next: no space char starts with one delimiter char ends with one delimiter char has no other char as delimiter char. Updated sorry missed that should only be one delimiter char at start and at the end
This code I converted VB to C#. But i need to know how can use Hex in c# private string ConvertStringToHex(string sText) { int lCount; string sHex; string sResult; for (lCount = 1; (lCount <= sText.Length); lCount++) { [Code] .....
How would I convert the two individual byte values (in hex) to a decimal value representing the concatenated hex values? For example, if I have the
Dim byte1 As Byte = &H99 Dim byte2 As Byte = &H99
' I want the decimal representation of the hex value "9999" ' (byte1.ToString + byte2.ToString) which should be "39321" Currently I use the following code:
Dim decVal as integer decVal = Val("&H" + Hex$(byte1).ToString + Hex$(byte2).ToString)
However, when I use this, the value (decVal) comes out to "-26215"
I have a "result" which is DataTable and I like to get the x distinct values(City) and convert it back to DataTable how do I do this the code below gives me an error
Dim query = (From x In results.AsEnumerable() Select (x.Field(Of String)("City"))).Distinct().CopyToDataTable()
so what I want is records of distinct cities I can get that but the problem I am having is converting it back to Datable.
Edited:I am using "where" in this statement and it does convert to Table(works fine) but not on "select"
Dim results = (From myRow In ds.Tables(1).AsEnumerable() Where (myRow.Field(Of String)("xxxx") = xxxx) Select myRow).Distinct().CopyToDataTable()
I have just started using databases, but I am totally stuck. I made a database and table using MS Access. The table has three columns. ID, Code, and Letter. Basically, the Code column stores a number for each letter (eg. 1 = A, 2 = B, 3 = C, etc.)
This table is just for reference for my program, and I don't need to change any values. But I need a step by step guide to link this table to VB 2010 and convert the values of the table to an array. For example: convert the table into the array "example" which means that example(1) = A, example(2) = B, example(3) = C and so on.
I am developing a software that would scan the image in a picturebox and obtain the rgb values of each pixel in the image and convert each rgb values to HSL values. I am using vb 2008 express edition. I am still a student. All I have done is to obtain the image in a file and paste it in the picturebox. Below is my code. I dont really know how to start with the process of obtaining the rgb values of each pixel and converting them to HSL values and averaging the HSL value.[code..]
I have an unbound Gridview that is populated by a Linq to Entities query and would like to convert string values in a particular column to lowercase. In the Gridview's RowDataBound event, I have tried StrConv(e.Row.Cells(3).Text, VbStrConv.ProperCase) but this doesn't work. I have also tried StrConv(emp.Name, VbStrConv.ProperCase) in the LiNQ to Entities query but still the Name values returned are to converted to Lower-case.
Protected Sub GridView3_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView3.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then For i As Integer = 0 To e.Row.Cells.Count - 1 Dim cellDate As Date [Code] .....
in my application, I am pulling in items from a microsoft project file using mpxj - one of the items I need is the predecessors. The way I am able to pull the predecessor is using a build in function of mpxj which returns a type of java.util.list - I can save this to variable as an object, but I need to find a way to bring the data to a format I can easily use so I can store it into a database. Listed below is the line of code I am using to pull the predecessors from the project file.
Dim predecessors = task.getPredecessors
and here is the result when putting a tracepoint in to get the value of predecessors
Even if I could get the above as a string, I could work with it enough to get the data I need. The above example is where there is 1 item in the predecessor list, but sometimes there are multiple items. Here is an example of the tracepoint when there are multiple items.
I want to make live search form like when user enter 1 char then it ll find all data start with or contain letter.i have use the sql like query with textbox textchanged event but it is too slow any other method to make it fast?
Public Sub CreateXml() Dim db As New MDataContext Dim Customers = <gallery columns="3" rows="3">
[code]....
Could i mix local values with the ones returned from the LINQ query...Something like the following?
Public Sub CreateXml(ByVal **Col** As String, ByVal **Row** As String) Dim db As New MDataContext Dim Customers = <gallery columns="& **Col** &" rows="& **Row** &">