Reaching, Max value...
Assuming you have a database with at least one table, and some records.
Assuming also that the table contains a primary key or id field, and that key value increases automatically.
If you create a function that has id field records, and checks that this value is not greater than MaxValue.
If so, a message informs you of the event, otherwise, what you want to do, for example save the new...
User Profile
Collapse
-
Continue...
Work with IP addresses at least in visual basic, is a difficult task, given that there are no types to classify an ip address, since it is not a natural number, either integer or decimal.
That is why in most cases, you must convert ip address to an integer type Long, to work more comfortably.
But in other cases, you can work directly with the ip address.
Let's suppose that the first two lines...Leave a comment:
-
Seriously, :)
Well, it is something like that:
...Code:Dim NewRangeList As New SortedList() If start1<start2 min=start1 else: min=start2 end if If end1<end2 max=end2 else: max=end1 end if NewRangeList.add (min,max) PrintKeysAndValues(NewRangeList) End sub 'Getting final txt file, with sorted ranges.
Leave a comment:
-
About brackets, You are right.
I modified the code, but forgot to change it in the post.
Now I could not find the equivalent of these operators in vb. (?) and (:) and (---)
Can you help me, with this block of code?
I am storing start,end,start 1,end1 values, in SortedList....Code:min = (start1 < start2 ? start1 : start2) max = (end1 < end2 ? end2 : end1) New range: (min --- max)
Leave a comment:
-
Another one..
...Code:' do range before ip If Not (ip = start) Then start1 = start ' save this range. end1 = System.Math.Max(System.Threading.Interlocked.Decrement(ip),ip + 1) End If 'do range after ip If Not (ip = [end]) Then start2 = System.Math.Max(System.Threading.Interlocked.Increment(ip),ip - 1) 'save this range too. end2 = [end] End If
Leave a comment:
-
I use Visual basic (vs 2005) and WXP sp3.
I have no knowledge of c #. I'm trying to adapt your code to mine.
I must assume that this is correct?
1st range = Ip range entered by user, (208.77.188.236 - 208.77.188.243)
2nd range = Ip range in textline
start1 = userIpStart = 208.77.188.236
end1= userIpEnd = 208.77.188.243
start2 = arr
end2 = arra
Now, adapting your code to...Leave a comment:
-
adding something...
Since....
I get octets splitting (as you point below) ip address, entered by user. and same with each file line. (delimited file(-)). e.g.
208.77.188.166 - 208.77.188.183
208.77.188.195 - 208.77.188.206
208.77.188.210 - 208.77.188.255
Ip to excluded from range, (entered by user) : 208.77.188.236
Range container: 208.77.188.210 - 208.77.188.255...Leave a comment:
-
Explanation:
There are 10 lists,(lis1.txt , list2.txt, list3.txt and so on.) involved in the process.
They all contain IP ranges.
Now you imagine such an application like a firewall, that uses these lists to filter harmful ips for network, and its users.
Well, Ipfile.txt file is the sum of all these lists.
Obviously ip ranges have to order, when added to the final file. (Ipfile.txt).
Example:...Leave a comment:
-
Algorithm to merge ip address
I am developing application that manage a plain text, containing ip address ranges.
User will be able to add/delete ip from ranges.
Example to delete ip:
Ip entered by user through a text box : 25.2.0.58
Ip Range container: 25.2.0.10 - 25.255.255.255
the Algorithm should determine whether there is in text file, a range that may contain the ip entered by the user. If so, remove it from container ip range....
No activity results to display
Show More
Leave a comment: