VS 2008 Encoding Strings?
Apr 2, 2009I'm not sure of the name of the function i'm after but im trying to turn:
http://
into
http%3A%2F%2F
for example, is there a function i can use for this at all? i'm not to sure what to search .
I'm not sure of the name of the function i'm after but im trying to turn:
http://
into
http%3A%2F%2F
for example, is there a function i can use for this at all? i'm not to sure what to search .
I am working on a UDP Client/Server, and currently i have them sending back and forth strings, which i convert to bytes, and then open the bytes to read. I want to now send an Object instead of those strings, which includes multiple unsigned integers and strings.
View 39 RepliesI'm migrating from VB6 to VB.NET, in hence my questions below:
I have to write a function that returns array of strings.
How can I initiate it to empty array? I need it since I have to check if it's empty array after it returns from this function.
Is list of arrays better for this purpose? If I use a list - Is it empty when it firstly defined? How can I check it it's empty?
I am sending a DDE message to a client using System.Text.Encoding.ASCII.GetBytes(item) . However, before the message is actually sent, I would like to get the message coded where if the item="Ask" then item=Ask (string variable) and so on. The code is:
Protected Overrides Function OnRequest(ByVal conversation As DdeConversation, ByVal item As String, ByVal format As Integer) As RequestResult
' Return data to the client only if the format is CF_TEXT
[code]....
Say I have a List(Of Tag) with Tag being an object. One member of Tag, Tag.Description, is a string, and I want to make a comma-separated concatenation of the Description members.Is there an easier way to do this than to read the Description members into a List(Of String) and then use the Join function?
View 2 RepliesMy program has been running fine for months and still is, but I now have this warning, (which must have shown up since upgrading to VB2008 from 2005 a month ago).
It regards the serial port encoding setup and reads as follows -- serialport1.Encoding = encoding.GetEncoding(1252) 'for char > 127
Warning 1Access of shared member, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated. Perhaps there was an update on this with 2008 and it's now redundant or something?
I have problems sending sms using API. I need to sens sms encoded ISO-8859 The problem is encoding to ISO. Not runs
[Code]...
I tried to figure how can I read a text from a text file that is written in hebrew to a TextBox. I searched google for 3 hours and find nothing. I am getting a junk text into the TextBox. This is the code for reading the text file:
Dim txtReader As TextReader = New StreamReader(Me.txtPath.Text)
Me.RichTextBox1.Text = txtReader.ReadToEnd()
txtReader.Close()
How can I read hebrew letters?
I have a list of strings. For each string in that list, I want to prepend another string. I wrote a method to do it, but I was wondering if there was something already in .NET I could use to do this. It seems like something that could be built in, but I was not able to find anything.
Here is the method I wrote:
Private Function PrependToAllInList(ByRef inputList As List(Of String), ByRef prependString As String) As List(Of String)
Dim returnList As List(Of String) = New List(Of String)
For Each inputString As String In inputList
returnList.Add(String.Format("{0}{1}", prependString, inputString))
[code].....
It works, but I would rather use built in functions whenever possible.
im wounder how to make a string error like that in vb so if the user write echi and not echo on a string it will get a error like a other variant of this if richtextbox1.text = ("ecoi") then msgbox("string error") but only on 1 string
View 3 RepliesI'm going to start a project so what I need to do is make something that is kinda like an email. I am working with the register part of it because just like an email you have to select who to send it to.
View 5 RepliesI read a text file and I want to make some changes and still save it as a text file.The change is to add color to some strings. How to do it?
1 2 3
3 4 5
4 5 7
Then
1 2 3
3 4 5
4 5 7
I have been summoned with the task of taking a tab delimited file and converting that file so it can be read by a third-party program. I am trying to think of the best way to do this, but I am having a hard time. Here is a view of the raw data that must be altered:
fkstoreidHeaderMarkB1RegNodateofbusinessNoRegEntriesTipsOverRingsVoids$Voids#NetSalesDP1_2GuestsDP3GuestsDP4GuestsDetailMarkfkdaypartidRecTypeGLB2Sales
1061HNULL101/01/2008NULLNULLNULL113.263512785.4714453137D2041005NULL2220.25
1061HNULL101/01/2008NULLNULLNULL113.263512785.4714453137D3041005NULL9170.19
1061HNULL101/01/2008NULLNULLNULL113.263512785.4714453137D4041005NULL670.75
[Code]...
I am toiling with the best way of doing this. So far, I am not having much luck. I have used arrays quite successfully in Java, but I am not sure that this is the best way to go here. I would have to get how many lines there are and read each line. Make the changes, and then go on to the next line. I think scanning the document line by line using a loop is the best way. However, I am not sure.
Hopefully this question will have an easy answer; I've tried searching for the answer myself, but I don't know what to search for (I don't know what you would call this).
Is there a way to compare a string to see if it matches more than 1 value?
[Code]...
I have a database of tables that I needed to do some comparison work on and sql server is limited to the means of doing string comparisons. I put all the data into lists and thought of using [URL] or string.contains but does not seem like it is working right. It is large amount of data and I need to be able to make some matches in order to avoid the manual checking of each string. Here is sample data and code;
[Code]...
I need to make sure that a certain textbox only allows dates to be entered under a certain format EG: DD/MM/YYYY
View 8 RepliesI once again feel so angry about VB .NET . Here's what ruined my day :Lets say we have have a string variable :
Dim Var1 As String = "blablabla"
If we want to replace something within it , we can use the Replace function :
Dim Var2 As String = Replace(Var1,"a","o")
This works great . My problem appears when I want to replace the " character (double quote) . Thus , when using :Dim Var2 As String = Replace(Var1,"""","o")it will return an error .Of course you may wonder why I care to replace the " character . You see this string variable receives its value from a text box . Thus , if the user uses the " character , I want to replace it with two ' characters (single quote) . Is this replacement possible in .NET
I am trying to write an app which allows the user to input two times , in a maskedtextbox, and take those two times and add them together then output the result to a third maskedtestbox, I havent seen anything else on the web with the same problem, only with fixed date or time, nothing that the user can change.
I am guessing you have to input the a maskedtextbox as a string then parse them to datetime, add the two together and the convert the date back to a string at runtime my code always bails out with a datetime conversion
[Code]...
I have tried this:
If TextBox1.Text.Contains("example1" And "example2") Then
And
If TextBox1.Text.Contains("example1" And "example2") = True Then
[code].....
When i save data in my xml file i save a bunch of cities that the user has selected, i then proceed to load the data back into the program and populate the check fields besides the city
vb.net
'// Loop through each one and re-check them
For Each cityToCheck As Xml.XmlNode In nodeList
[code]....
This string stringSplit(0).tostring returns the city name say "Glasgow" i was trying to loop the listview that stores the cities, if they match then put a check mark, this is where the cities are located: (formAddCities.listViewCities.(FIRST ITEM IN COLUMN WHICH IS CITY NAME) the very first column in the listview, but i can't seem to get the right syntax?
If I were to execute five different SQL-commands, wich of these way would be the best/most effecient?
Dim sql(4) As String
sql(0) = "SQL-string 1"
sql(1) = "SQL-string 2"
sql(2) = "SQL-string 3"
sql(3) = "SQL-string 4"
sql(4) = "SQL-string 5"
[Code]...
q1/ how can i convert a lowercase string to sentence case with LINQ, without losing my rtb formatting?
View 2 RepliesI have the html of a page loaded into a string.
confirmUse('??????','Eat'
I want to extract the number that the ?'s represent however confirmUse is used in other parts of the page. The only constant is the 'Eat' which is unique to this specific number.
I usually use Mid and Instr to find what I need but when I try to back track it gives me an error because the index number is below 0.
Basically what i want to do is when a command button is clicked and it has run the code at then end i want a label to display one string out of many at random. How would i declare the various strings and then get it to display one at radnom
View 7 Repliesim trying to read "calculator" from calc.exe, now i found the mem adress where the value resides but i have a few problems
1) how many bytes should i read? im not just talking about calculator string but potentially any length string, i get different results with 4/8 bytes but same from 8 - 32 bytes
2) when i read i get a long value 27866486557179971 but how to convert that into a string
EDIT: ok by staring at the return value long enough i discovered that when i convert it to hex it spells "calc" backwards, same for all other strings, i could build a working converter based on that knowledge but now what bugs me is where is "ulator" or the rest of the string, the most i can get is always 4 letters
EDIT2: oh nm that, by moving memory adress a step further i get the next letter along with 3 previous ones and still backwards but i can work with that
ok so now next step would be making a search function for which i need to find out the range of memory to scan, anybody know how to do that?
i have a multiline textbox and it add a load of info to it.
What i need is for it to remove all strings befor the : char.
For example if the line was this: this is just an example : hi there how are you ?
it would remove all befor the : and be left with: hi how are you ?
Alright i have 3 strings in a class1.vb. In form1 it will put in a text. In form2 it will read the 3 strings and print them on 3 textbox
View 1 RepliesI recently had to use my "String converter" to convert 20 lines of text to a single line of "VB .Net String coding". For example:
This is line one
This is line two
This is line three "with extra stuff"
[Code]...
"This is line one" & vbCrLf & "This is line two" & vbCrLf & "This is line three " & chr(34) & "with extra stuff" & chr(34) & vbCrLf & vbCrLf & "Empty line above me"What is the best way to represent these types of Strings? For example, if you have to display a long message or just a label with information that changes.I was thinking of some sort of text file collection, but it is a little useless to have 100 text files of information of 5-6 lines.
I have the following
Dim input As String
If e.KeyCode = Keys.Enter Then
[code].....
i'm currently trying to make a connection between my phone to my PC using vb .net and a program I will build for my phone.my phone should send information (some strings) through the com port, I wrote in google "VB .net bluetooth" and I sew there is a library for vb .net, but I don't think I need that library, can I communicate with a com port without this library? like making a connection with a normal com port?If I'm right, how do I do that? how can I recieve information from the bluetooth com port?
View 7 Replies