I made this small location class so that I can better handle address information which I am going to be sending off in requests to the Google Maps API. One thing I have left to do is some validation to make sure that the address has enough information to return a result back. For the application, the level of accuracy should be as loose as a single City (meaning that it should work as long as a zip code or city/state is provided since it will find the geographic center of that area automatically in Google Maps)
In member register page, I added email address validation but it only check the email address format, such as .com, .net, .org.If user inputs fake account such as aaabbb01010@gmail.com, how to verify it and return an error?
I have been using a function to validate email addresses for awhile now. Yesterday i discovered that the code indicates that 2 different email addresses are invalid when in reality they are perfectly fine.
The code uses RegEx to determine if an email address is valid. I have tried to understand RegEx, but I can never seem to figure it out. Here is the
Private Sub btnCheckEmail_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCheckEmail.Click If ValidateEmailAddress(txtEmail.Text) = True Then
[Code]....
How can the RegEx be re-written to allow the local part (before the @ symbol) to be 1 character, and/or be a number? I understand the "a-z" part, but i don't understand what [w.-] means, or why the a-z is duplicated before the @ symbol.
I'm trying to get started with Fedex'es Address validation service and I'm running into a road block with FedEx's own demo application. [code] It seems to send the request object to the web service, but the"reply" object is returned with "Nothing". I could understand if I wrote the code, but good god... they can't even get their own code to work?
I have a txt box that askes a user to enter his email address and I want to make sure the user enters a correctly formatted email.
The code I have so far is like this If txtEmail.Text = "" Then txtEmail.BackColor = Color.Pink MessageBox.Show("Please Enter your Email") Exit Sub Else txtEmail.BackColor = Color.White End If
How I can modify this code to make it work and is regular expressions the same for all programming languages? Also for my mobile number text box I only want a user to enter a 10 digit number with only integer numbers.
The code I have so far is If txtNumber.Text = "" Then txtNumber.BackColor = Color.Pink MessageBox.Show("Please Enter your Mobile") Exit Sub Else txtNumber.BackColor = Color.White End If
My Regex works, except if the email address entered has an underscore character (_) in it.
Because of my lack of experience with regular expressions, I'm not sure where in my pattern I'm supposed to add the offending character to allow it:
Dim pattern As String = "^[-a-zAZ0-9][-.a-zA-Z0-9]*@[-.a-zA-Z0-0]+(.[-.a-zA-Z0-0+)*." & _ "(com|edu|info|gov|int|mil|net|org|biz|name|museum|coop|aero|pro|tv|[a-zA-Z]{2})$"
He said he fixed it by adding the _ after the numeric check.
I see the A-Z0-9, but I'm not sure which is the numeric check...
I have to make a basic program that: Create a program with a simple interface that
1. Asks the user type his/her email address into a textbox.
2. When the user clicks the "Evaluate Email Address" button, one of two message boxes pops up: "That is a valid email address!" with an "Information" icon, or "That is an invalid email address!" and on a second line, "Please retype your email address.", with an "Exclamation" icon
3. To be considered valid, the email address must -include an "@" symbol, and -it must end in either ".com", ".net", or ".org" or ".edu" (I don't know how to check a string and test if its last four characters end with any of these and make it say not valid email address. I think I might have to use a case statement)
I am creating a card game and although I have a solution to my question it feels very forced and awkward. What I want to be able to do is to iterate through a collection but not necessarily start at the begnining or stop at the end.
Some details/examples. Imagine a game (I'll mentally use Spades) with 4 players.
Player 1 Deals cards to all 4 players which makes Player 2 the first to bid. The rub is that after player 4 bids, player 1 should then get his turn to bid.
Player 1 <-- Dealer Player 2 <-- First to bid Player 3 Player 4
I can't just iterate over the collection because a For each p as Player in Players would never make it back to player 1 to allow him to bid. As I said, I can make it work with some nested loops but I'm hoping someone might have a better solution. It certainly feels like there must be one. I run into more of the same as the deal moves around the table and as tricks are taken. If a more detailed example is needed, feel free to let me know.
I am converting an old Vb6 solution to .net 2.0 in vs2010. I've been working in C# for about 3 years now and .net for 5. I don't recall having this problem in C#, but if I want initialize a readonly collection of DerivedControlFoo Is there a clean way to do it besides creating a sub to do it all off somewhere else? I'd love to be able to do it at the class level at the declaration for readability and simplicity.
Are there any IP Address filters or masks available in Windows Forms as per following screenshot? A backslash shouldn't be allowed or it should be filtered somehow.
SocketException was Unhandled: Only one usage of each socket address (protocol/network address/port) is normally permitted I get this error every time i click collect a second time.
I made web browser which consist address bar that I use it to type addressess in it i.ewhen I type [URL] it opens [URL] but when I go to anther page in google it doesnot show it's link in address bar lix InterntExplorer or other international browsers so how to show any link or any sub page's link in my browser address bar ?
I'm trying to use the DHCP API (using the references on pinvoke.net) to retrieve a computer's MAC address when given the IP address but I can't get the code to work. I've run all the C# code on pinvoke.net through the C#-to-VB converter but I'm stuck now.
Here's what I have so far. The value of res is always 5 (should be 0). Thing is, I can't find any documentation on what the return codes mean
vb Private Sub GetMACDim client As String = "1.1.1.1" Dim server As String = "0.0.0.0" Dim si As New NativeMethods.DHCP_SEARCH_INFO si.SearchType = NativeMethods.DHCP_SEARCH_INFO_TYPE.DhcpClientIpAddress si.ClientIpAddress = Convert.ToUInt32(StringIPAddressToUint32(client)) Dim res As UInteger Dim oInfo As IntPtr
It seems that when using With blocks in VB.NET, the resulting MSIL larger than w/o. So this leads me to ask, are With Blocks really more efficient? MSIL is what gets JITed into native machine code, so smaller code size should imply more efficient code, right?
I need to verify if a certain user exist on my asp.net site.I want to know if which of these two functions is more efficient, faster and better compared to each other and why.
I am working on an application that will need to read tons of records (close to 500,000) from one table and insert them into another set of tables in the same database. I though about using SSIS package for this but our DBAs don't want to use that. Now, I am thinking of a multi-threaded approach. I am thinking that I can have a few thread started that will read say (500) records at a time and insert them, then come back and read more.
Now, say I spawn off 3 threads of this application. The first thread reads 500 rows and starts processing them. Can I lock these rows that were already read so that the next thread does not pick them up? I am trying to find some articles regarding this on the internet, but perhaps I am not searching for the correct terms in Google.
I'd like to sample the data from the Arduino @ roughly 200Hz. Is there a more efficient way to do this than using a timer (which is what I am currently using)? Currently I am using[code]....
if there is no need for my variable to store negative values, is it more efficient to use UInteger instead of Integer? both are 4bytes and i've got a feeling unsigned works faster though i'm nt sure about it. note that the range of my variable is 0 to 2147483647, hence i could use a UInt32 or Int32 and both would give me the same result so i'm wondering about optimum performance.
I have been reading books trying to learn .net on my own. I am working on an exercise that asks me to create a 1MB file. what i have below does work, but it seems to me there would be a more efficeient way. It seems like what i am doing would cause a lot of overhead. making a 1MB file easier than what i have?[code]...
I have a program that must initialize a table that is usually about 10-15 thousand records. I have attempted several means to empty the records from it, but it always takes several minutes to accomplish the task or in some cases like a 'bindingsource.clear' command, doesn't work at all. I currently have it working using a simple loop to go through each record at a time and 'removecurrent'. but this seems extremely inefficient and it is quite slow.The real time consumer seems to come in with the tableadapter.update and tableadapter.fill that happens after the loop.[code]
I've an arraylist having 30000 items in it, what's the best way of creating a text file on the fly from an ASP.NEt page? Currently I'm using the code below but it times out with large data,[code]