Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Split IPs to 8 and 16
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { string ips = @"0227000694-sherka:41.131.29.160:29 025104964:41.196.111.224:29 0224576662-Elshreka:41.131.50.72:29 0224571537-Joseph:197.162.150.112:29 0224573235-Sherkaa:41.196.111.96:29 0233133330-tarek:41.131.16.24:29 0223655888-Mohamed:41.178.191.96:29 0222021138-abdel:41.178.73.72:29 023640111-ramzia:41.196.138.144:29 025124125-mohamed:197.167.67.48:29 0227001568-Khaled:197.161.202.160:28 0225104963-Co:41.131.29.104:29 0222037695-anwar:41.178.73.200:29 0846330501-dlz:197.161.202.216:29 0225329099-Elsherka:196.205.212.184:29 0223654403-Company:41.178.180.224:29 0224607934-ahmed:196.205.157.160:29 023645614-amr:197.160.40.248:29 0223652728-Ahmed:197.161.151.72:29 0223619120-salah:41.178.166.240:29 0224620761-emaad:197.162.150.24:29 0224607902-nashaat:41.131.49.120:29 0223648046-edara:196.205.217.176:29 0222050023-samy:41.178.84.32:28 0224593846-MSAN:197.161.202.48:29 0222032881-abd:41.196.183.200:29 0223630880-Sherkaa:197.167.66.0:29 0223684381-edara:196.205.172.32:29 0225314140-elsherka:197.161.38.112:28 0223130301-fadl:41.131.28.232:29 0224319223-alsayed:197.162.151.0:29 0224303218-company:41.196.126.96:29 0224572084-mahrosa:82.201.176.192:29 0224593995-Makhazen:41.131.48.56:29 023648473-dalydress:41.196.204.208:29 0223644529-sherka-lz:197.166.194.56:29 0224573066-Rizkallah:197.162.149.248:29 0226183133-atef:196.205.137.0:29 0225121054-mohafzt:41.131.28.216:29 0225126787-waleed:196.205.168.152:29 0225325571-Mohamed:197.167.67.8:29 0223619045-hospital:41.196.198.128:29"; var ipsArray = ips.Split(new string[]{Environment.NewLine}, StringSplitOptions.RemoveEmptyEntries); foreach (string ipLine in ipsArray) { var lineContent = ipLine.Split(':'); int subnet = 0; if (lineContent[2] == "28") subnet = 16; else subnet = 8; for (int i = 0; i < subnet; i++) { int lastOctet = int.Parse(lineContent[1].Split('.')[3]); Console.WriteLine(lineContent[0] + " " + lineContent[1].Split('.')[0] + '.' + lineContent[1].Split('.')[1] + '.' + lineContent[1].Split('.')[2] + '.' + (lastOctet + i)+" "+DateTime.Now.ToString("yyyy-MM-dd")); } } } } }
run
|
edit
|
history
|
help
0
oooo
Main Math
example
COMPLEX NUMBER
line 1 syntax error
pause a thread
Code
Url Encode
C# INDEXER and OVERRIDE INDEXER
Calculadora