2 input textbox & 1 output textbox
I have to generate end ip address depend on No. of static ip & start ip address
e.g
No of static ip=5
Start ip =192.168.10.10
then generate output as
end ip = 192.168.10.14
my aspx code is as following
********************************************************************************************
| : | ||
| : | ID="RegularExpressionValidator6" runat="server" ErrorMessage="Invalid IP !" ControlToValidate="txtStartIP"> | |
| : | ID="RegularExpressionValidator1" runat="server" ErrorMessage="Invalid IP !" ControlToValidate="txtEnd_IP"> |
******************************************************************
so please help me in coding part because I just started Programming & new in programming
Guest UserPosted Aug 10, 2014, 3:13 AM
Guest UserPosted Aug 14, 2014, 7:57 PM
i++;
string temp= oct.join(","); //convert it back into e.g., 192.168.1.2 then 192.168.1.3
string sql ="insert into table1 (IPaddress) values (" + temp + ")";
db.Execute (sql);
Sanket JainPosted Aug 14, 2014, 1:49 AM
Start ip=192.168.10.1
No. of Static Ip=5
End IP=192.168.10.5
I want to store all 5 ip's in database
i.e. 192.168.10.1 ,
192.168.10.2,
192.168.10.3,
192.168.10.4,
192.168.10.5
so i use between operator i.e between('192.168.10.1','192.168.10.5')
but in insert query we can't use between operator
so gives me hints for that
Guest UserPosted Aug 13, 2014, 2:51 AM
i got confused, why do you need BETWEEN sql operator to store data.
user INSERT to store. rite
Sanket JainPosted Aug 13, 2014, 1:59 AM
Now I want to store that IP's in oracle database
How to generate the middle ip's I can try between operator but it shows wrong output so gives me hints like previous
Sanket JainPosted Aug 9, 2014, 1:45 AM
I'm taking 2 variables & in that variables stores static ip & start ip
I am not able to divide start ip in 4 parts so tell me how to divide this.
Guest UserPosted Aug 9, 2014, 1:37 AM
Looking forward for interaction future...
Guest UserPosted Aug 7, 2014, 9:07 PM
For this requirement you need to right algorithm which will read via octect. IP adderss is divided in range from 0-255 in each octet. Suppose user enters in text box find
Example1
192.168.1.250 and static IPs: 10, so the output should be
192.168.2.5 -> txtEnd_ip
If you agree to this, please mark this "Acccepted" answer and then we shall proceed in writing logic to solve Example1