|
No, because you're creating an odd definition of 'equal'. You may be able to use regex to create a string that allows arbitrary spaces between each character, but it seems like more work than just stripping them, to me.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Thanks for help,
I will evaluate what is more convenient to do.
Strings that I must compare can have until 23 commas!
Ignazio
|
|
|
|
|
hope so this will work , I did this thing for you but MVPs don't recommend this because copy paste will not enhance your programing skills
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim str1, str2 As String
str1 = "softdev_sup"
str2 = "Softdev_ sup"
MessageBox.Show(String.Compare(str1, str2, False))
MessageBox.Show(String.Compare(RemoveSpace(str1), RemoveSpace(str2), True))
End Sub
Public Function RemoveSpace(ByVal strText As String) As String
Return System.Text.RegularExpressions.Regex.Replace(strText, " ", _
String.Empty, System.Text.RegularExpressions.RegexOptions.IgnoreCase)
End Function
Best Of Regards,
SOFTDEV
Sad like books with torn pages, sad like unfinished stories ...
|
|
|
|
|
Hi,
The code you posted seems to be exactely that I was looking for.
With great surprise, differentely I was thinking, it is also fully compliant with Compact Framework, without any modification.
Running the code, the first message is "1" and second is "0".
To reduce the impact on the programing skills, I will do the work in 2 steps:
A first pass will exclude strings 100% equal (considering also spaces), from the 2nd pass that will compare only remaining strings using the RemoveSpace function.
Thank you very much.
Ignazio
modified on Monday, September 7, 2009 12:44 PM
|
|
|
|
|
u r welcome man say thanks 2 code project
Best Of Regards,
SOFTDEV
Sad like books with torn pages, sad like unfinished stories ...
|
|
|
|
|
Dear All,
i am VB.Net User with Visual Studio.Net i want to genrate a project for FM Radio. They have some secrete MP3 files. So, they want to store them in there Data Base.
Dear All my Question is that how can i do that Using Visual Studio with Visual Basic.Net. If Someone has complete knowledge about this so plz help me.
Waiting for ur reply
Abdul Rouf
|
|
|
|
|
storing bulk data is always the same, whether it is one image, one movie, one audio track.
CodeProject has lots of entries on storing images, and so does Google.
|
|
|
|
|
They (you) really want to store the MP3s in the DB? Personally I prefer to store them in the file system and then store meta-data about the files in the DB (ie: keywords, title, musician, etc...) along with the storage location in the file system.
|
|
|
|
|
Hello To all
I have a text box that displays the date and it work my problem is it dont change when the date changes to the next day ??
here is my code Textbox1.text is the text box with the date in it
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Enabled = True
TextBox1.Text = Format(Now, "M")
Timer1.Interval = 60000
Timer1.Start()
Thanks everyone for your help
everyone has been grate here
Bob
|
|
|
|
|
Ask yourself when and how often does Form1_Load execute.
|
|
|
|
|
Thanks Luc i shold have no that hehe
Thanks to good pepole like your self
pepole like me can lern vb
This is what i did to fix it and it seems to work
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
TextBox1.Text = Format(Now, "M")
End Sub
Thanks agine for every one help
|
|
|
|
|
I want to create "views" of a web page, to do that I´m retrieving and editing the html code to show what I want in a new small webbrowser:
Dim PageHTMLBytes() As Byte
Dim htmlText as string = ""
PageHTMLBytes = webClient.DownloadData(url)
' Convert result from byte array to string
Dim utf8 As New UTF8Encoding()
htmlText = utf8.GetString(PageHTMLBytes)
...
-Edit of the html code-
...
miniWebBrowser.DocumentText = editedhtmlText
The problem is that one part of the editedhtmlText I´m showing, is a flash object which checks if you are logged in, but it doesn´t matter if I logged before, as soon as I set my own, edited code, the session is lost. I tried setting cookies like this:
Dim request As HttpWebRequest = WebRequest.Create("http://www.cam4.com")
'Set cookies.
request.CookieContainer = New CookieContainer()
request.CookieContainer.Add(New Cookie("user", "usuario1", "/", url))
request.CookieContainer.Add(New Cookie("password", "password1", "/", url))
Dim response As HttpWebResponse = request.GetResponse()
Dim reader As IO.StreamReader = New IO.StreamReader(response.GetResponseStream(), True)
Dim html As String = reader.ReadToEnd()
web.DocumentText = html
..which throws no errors but no luck at all in keeping my session. I started to fiddle about with webrequest and responses instead of downloading the html code, but I couldn´t go much further.
I´m on Windows XP 32 bits, VB 2008 Express, Net. Framework 2.0 SP1 (for legacy support). Some assistance on how can I aboard this problem will be appreciated.
|
|
|
|
|
|
Hi all
I am creating a program in which I am executing a bach file, which requires a "Enter key" hit to execute, as below :
Dim prc As New Process
With prc.StartInfo
.FileName = "e:\abc.bat" 'batchfile to execute
.UseShellExecute = False
.RedirectStandardInput = True
End With
prc.Start()
prc.StandardInput.WriteLine("{enter}")
prc.Close()
Now the above code run successfully and it appears a command prompt window showing "e:\abc.bat" file is executing but the code
prc.StandardInput.WriteLine("{enter}") is not redirecting enter key to completely execute the batch file.
How can I use "Enter key" hit on that command prompt window in vb.net.
Thanks.
Gagan
|
|
|
|
|
Lookup Console/StandardInput.ReadLine() or .ReadKey() and test for enter.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Thanks Henry for your suggestion but I have already tried these methods and there is no effect when a command window appears showing "abc.bat" is running.
I only want to do that when my batch file start executing, it takes a "Enter key hit" from program to completely execute my batch file(because it requires a Enter key hit for further execution)and not wait for hitting Enter mannually from user.
Suggest me how can I do that.
Thanks.
Gagan
|
|
|
|
|
Hi,
I hava piece of code which creates a networl drive on the user's system. I need to hide the network.
The purpose of doing this is that the user while using an application need to connect to the Access db on a file server. But shouldn't know that the drive is mapped onhis computer.
Thanks
Sanjeev
Sanjeev
|
|
|
|
|
I may be misunderstanding your problem but doesn't the standard Data Source parameter accept a URI - ServerMachineName\PathOnServer.mdb?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Then don't map the drive. Use the UNC path that the map points to instead.
|
|
|
|
|
I have one form in which I am searching the database table as :
cmd = New SqlCommand(" SELECT * FROM client_details WHERE DateofJoining BETWEEN #" + ddfrm + "# AND #" + ddto + "# ")
con.Open()
where, "client_details" is my database table name. And "DateofJoining" is a column.
In 2nd form, I have a datagridview, in which I have stored the data with several columns.
I want to get the number of rows from the updated datagridview in 2nd form using the filtered criteria which I did in my 1st form above.
I am trying but not able to update the datagridview using the filter.
Do i need to call any public function in 2nd form from the 1st form?
|
|
|
|
|
Yes.Make it as a Public Function in form1 and then call it from form2.
|
|
|
|
|
hi,
was wondering if it is possible to code a program to "right click" / bring up context menu for a file.
so to be a little less vague;
i have heaps of templates (win word, excel...), you right click and select "New"
which opens the respective office app with the template loaded into a fresh doc.
how could i do this programatically, rather that simply opening the file through vb or doing it manually?
apologies if this has already been answered, i have searched for it
-N
|
|
|
|
|
Right click on what?
There is an article around with global keyboard and mouse hooks I saw recently.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
|
Yeah but you must be viewing the list of templates in something, explorer presumably!
Never underestimate the power of human stupidity
RAH
|
|
|
|