From 50a159ff5cb6e9db1c7708cec62708398006429c Mon Sep 17 00:00:00 2001 From: szabomarton Date: Mon, 4 Dec 2023 11:21:13 +0100 Subject: [PATCH] Geri hf hozzadava --- 20231204/ConsoleApp1/.vs/ConsoleApp1/v16/.suo | Bin 0 -> 12288 bytes 20231204/ConsoleApp1/App.config | 6 + 20231204/ConsoleApp1/ConsoleApp1.csproj | 53 +++++ 20231204/ConsoleApp1/ConsoleApp1.sln | 25 +++ 20231204/ConsoleApp1/Program.cs | 15 ++ .../ConsoleApp1/Properties/AssemblyInfo.cs | 36 ++++ ...ework,Version=v4.7.2.AssemblyAttributes.cs | 4 + ...ConsoleApp1.csproj.AssemblyReference.cache | Bin 0 -> 4084 bytes ...gnTimeResolveAssemblyReferencesInput.cache | Bin 0 -> 6785 bytes 20231204/proga_hazi.txt | 195 ++++++++++++++++++ 10 files changed, 334 insertions(+) create mode 100644 20231204/ConsoleApp1/.vs/ConsoleApp1/v16/.suo create mode 100644 20231204/ConsoleApp1/App.config create mode 100644 20231204/ConsoleApp1/ConsoleApp1.csproj create mode 100644 20231204/ConsoleApp1/ConsoleApp1.sln create mode 100644 20231204/ConsoleApp1/Program.cs create mode 100644 20231204/ConsoleApp1/Properties/AssemblyInfo.cs create mode 100644 20231204/ConsoleApp1/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs create mode 100644 20231204/ConsoleApp1/obj/Debug/ConsoleApp1.csproj.AssemblyReference.cache create mode 100644 20231204/ConsoleApp1/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache create mode 100644 20231204/proga_hazi.txt diff --git a/20231204/ConsoleApp1/.vs/ConsoleApp1/v16/.suo b/20231204/ConsoleApp1/.vs/ConsoleApp1/v16/.suo new file mode 100644 index 0000000000000000000000000000000000000000..0e52389c52c6697992ce0af17e37909cc722a874 GIT binary patch literal 12288 zcmeHN%WoS+7$5fmZF%)U1C&BTTS9?sSU=)8DQ)9j$Fx#ILh~p{mXKpRX;R0w>?F`O zm5{h{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k*+@k#%5Ke+Sb7hMm3=`akx{Lqi8=dEWdgMOc7zjpZ_8cvUI1kc?!GC4L% z{)f!5QTM&4aZT)Y3*(8qwA1E(*OR;swWa;5c}!3qDgPqKgqO;Q3FH*kzE1|Vn=bI%g`Fk|M9Ij<|YHsL!n@PWGAzYfbMldDy#<+){CFD}fMOVvU#yD+;{ z7(nYxH9L>{%geWtakDQLOC~gZD2CUj&A66G#FLsHk3|wuy*C!`i`~YULu%Z!gIk29 z)Ry4mz-V2Xp(gci-7Xr>u7kSQV^x+Lm5nJuXg$w>Zgj*>{0=~duz0Z)<#i5?Oi*4G2K)i=HIgY}?feJ&?`5cmID`5^AiIDJsAi4V$2 zpQX6r>e2E+lvEQ|Cv1)`>hNgJpH{!}t~sA!{mB;YB@SaMi);DEzhoUmii-Kvo-vhwcMu=#fMgYocc07{`6?2^h#`)3}bxeS!pf8R&Hz zxo{rej2dyRU2`WYHKehR;?3IkX5W3-OA=x;c{?kpotyc_9>;#sGUQakE>$O_GK$FA zga424YX-j@Uqh`3$v9<@+;m>JFU{R(e!nY-jq*dYPl8vjXqWK33I1m!$NS_L)zzIb z_nWzvQH9@8kKiICerh|k<_0p0wL-O)sol&@mFKh7g>osAFVwCtlq;FssZ2zVM8gq1 zmdRORIg7BIX*c|CBeql9hF3@EzF-byCf3Yq%AQrzF{_SbE3=vgwEO%PPZxs3Y-M{q ze}2EM@Qwd%xc`AugGZZ`u`Uds#=T&#!ffgr_>QNwda&XKzZP>Bum}E&`@zAbxbpqO adv}k_{bt-h`C#PN>|b7E-MP2<68InN5czxn literal 0 HcmV?d00001 diff --git a/20231204/ConsoleApp1/App.config b/20231204/ConsoleApp1/App.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/20231204/ConsoleApp1/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/20231204/ConsoleApp1/ConsoleApp1.csproj b/20231204/ConsoleApp1/ConsoleApp1.csproj new file mode 100644 index 0000000..a4bb44b --- /dev/null +++ b/20231204/ConsoleApp1/ConsoleApp1.csproj @@ -0,0 +1,53 @@ + + + + + Debug + AnyCPU + {13CBD21B-6A7A-4A5C-BC61-3B8FC3EC84B5} + Exe + ConsoleApp1 + ConsoleApp1 + v4.7.2 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/20231204/ConsoleApp1/ConsoleApp1.sln b/20231204/ConsoleApp1/ConsoleApp1.sln new file mode 100644 index 0000000..ec737dc --- /dev/null +++ b/20231204/ConsoleApp1/ConsoleApp1.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.33529.622 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp1", "ConsoleApp1.csproj", "{13CBD21B-6A7A-4A5C-BC61-3B8FC3EC84B5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {13CBD21B-6A7A-4A5C-BC61-3B8FC3EC84B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {13CBD21B-6A7A-4A5C-BC61-3B8FC3EC84B5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {13CBD21B-6A7A-4A5C-BC61-3B8FC3EC84B5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {13CBD21B-6A7A-4A5C-BC61-3B8FC3EC84B5}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {6FB0DF0D-BC48-48DC-8195-EA8FDB0AB190} + EndGlobalSection +EndGlobal diff --git a/20231204/ConsoleApp1/Program.cs b/20231204/ConsoleApp1/Program.cs new file mode 100644 index 0000000..ea9bacc --- /dev/null +++ b/20231204/ConsoleApp1/Program.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConsoleApp1 +{ + class Program + { + static void Main(string[] args) + { + } + } +} diff --git a/20231204/ConsoleApp1/Properties/AssemblyInfo.cs b/20231204/ConsoleApp1/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..22f922b --- /dev/null +++ b/20231204/ConsoleApp1/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("ConsoleApp1")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ConsoleApp1")] +[assembly: AssemblyCopyright("Copyright © 2023")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("13cbd21b-6a7a-4a5c-bc61-3b8fc3ec84b5")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/20231204/ConsoleApp1/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs b/20231204/ConsoleApp1/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs new file mode 100644 index 0000000..3871b18 --- /dev/null +++ b/20231204/ConsoleApp1/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] diff --git a/20231204/ConsoleApp1/obj/Debug/ConsoleApp1.csproj.AssemblyReference.cache b/20231204/ConsoleApp1/obj/Debug/ConsoleApp1.csproj.AssemblyReference.cache new file mode 100644 index 0000000000000000000000000000000000000000..4eb356a34040e9562b3b7a28d7e29cc58b9f53d1 GIT binary patch literal 4084 zcmcInOK;RL5YC8)mMsGD5K<)$dqIMWRcOVd7X;~69Ow#dD&P>Qa=p&3)x_D_-lf~i zo;mYJxbaJRMB=AlholgaOO#0tQ5;9(neUsKZ*uT<9QXh?JkJB_?}i^#I#o0o?2DM| z!Q-=+&!2>29&yDb-8<7h}x@>-=RFw+B7D{Ba(B+}!!~HQTXP z?&rt&sf@&Qp{Nn5Y-I8K>!bCZi~eq5v7cM~oWzanls$9S$|%peMA*tkq8#ap;o&4Fc?Ij~0!CGHk* zGdwd~YFi4rCL>(Ep=CsYl{>fvRyZk9IOC_t#EDLbyOadt2Q#YXU2}y|bx05c+{%k= zZzX9WSfku2_v~t&O*)~gaM;yZRhzSk087>|n8NDS_wu+86_uJYC$PE^TmQG$+quEf zBC#!-wKIl406fUuD|E%DY$oKiQOM;4MN<@j&D^=6G+fP<(A>)2QZU{O#j=0Z0_t>F z8F5428B^EpP-jDoB0_3+RfJiWEy|69)eeQK`xxNf&67EsT!PcM-N=pqGf-u%Q(~iH%yQDpf3nM2SN4Q)0%~W!iNyUY`o>?~1_>)TJJX?E`t-H+AlG>@{j#sm}`73Lc z#UXRoYw2u#slHOrWUQq$&C(HsT>T8v&mOle#M^Q;lcM>Xq|GLiMv=-bx9Ms100uvx zwk?jCwV@PqYIbY$L^Bs>r6xc-C)_%36u8Z1OzK+PqMCIzu~p62J=-ow>ab%W54&Au zT7$mn3w;G)Tj1|wY%EjRU^*C9@@k6dZ7`yq^M)%V%dH{^|xYRJ-l%ft1La(MI zYjCAyt2ZDHj%kJ=oC8DWgK-XJ=2F)?;qpT!pI+ab=c;Mb76M)#*h#ec_P`w}Os15O z8!&sW!6!($&Jbo5Jy&ywb%tEF)Q*yx^%N_zI+M%=Qw1p;F!~WJ-ILu`KP+U33=ice5i$WHe_HG?r`IJQ(#KS?N4j`&A-z}u%BzIUHk!>$MbtimPR(ne zCXmiD5Thc4?xTPO_gIi&QuBbtzrx8+f_QjweqFNPo+n9w#x!aq0~eCM2V@EjbhN&P z_n4!&O{U>(3|iAhHl59^#lL~SBV!2+F8-1k6vi=k9gEzD_n2YXHktL`*a=Hu{4vG^ zN&in@6b%T8Vfq&WG6zOD7y;JT0P>&o?*hpeC#%aZD?vn(owWeId~VeOcQ3AArR{M~ z(a4n!sBHRf%mW+^1+GgJeVB&;V}$|}Fj>ibq(^{s6ed!hYHFY;G2Oe;`Ph%c_R`13 z?0W)8`(b*CAV~nh-QE9G>@3+6oKGx7@h`$N5d z08106MS6?`5i65tBn3@h#y@Ku89TD^1d?pLT#z3@gtJ)00Mpe_@}NLXY5^%u_#_@+ b?)Zz3nSsynUxTykzy1$0ILm_ibanh+pO?ir literal 0 HcmV?d00001 diff --git a/20231204/proga_hazi.txt b/20231204/proga_hazi.txt new file mode 100644 index 0000000..0276802 --- /dev/null +++ b/20231204/proga_hazi.txt @@ -0,0 +1,195 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Runtime.Remoting.Metadata.W3cXsd2001; +using System.Text; +using System.Threading.Tasks; + +namespace hazi_generator +{ + internal class Program + { + static void eldontes(char valasz) + { + if (valasz == 'a') + { + alapSIM(); + } + else + { + PUKosSIM(); + } + } + + static void PUKosSIM() + { + PUK[] listaPUK = new PUK[3]; + Random r = new Random(); + + for (int i = 0; i < 3; i++) + { + int Sorszam = r.Next(10000000, 99999999); + PUK PUKosSIM = new PUK(); + PUKosSIM.AlapSim(Sorszam); + listaPUK.SetValue(value: PUKosSIM, index: i); + } + + foreach (SIM item in listaPUK) + { + Console.WriteLine(item.Sorszam); + Console.WriteLine(item.Pinkod); + Console.WriteLine(); + } + + for (int i = 0; i < listaPUK.Length; i++) + { + Console.WriteLine("Kérem adja meg a PIN kódot (3 lehetőség)"); + for (int j = 0; j < 3; j++) + { + listaPUK[i].SimLetiltas(listaPUK[i].Sorszam, listaPUK[i].Pinkod); + if (listaPUK[i].Tudta) + { + break; + } + } + if (listaPUK[i].Tudta) + { + Console.WriteLine("A SIM feloldva"); + } + else + { + Console.WriteLine("A SIM letiltva"); + string puk = Convert.ToString(r.Next(1000, 9999)); + Console.WriteLine($"A PUK-kódja: {puk}"); + listaPUK[i].Puk(puk); + } + } + + Console.ReadKey(); + + } + + static void alapSIM() + { + SIM[] listaSIM = new SIM[3]; + Random r = new Random(); + + for (int i = 0; i < 3; i++) + { + int Sorszam = r.Next(10000000, 99999999); + SIM alapSim = new SIM(); + alapSim.AlapSim(Sorszam); + listaSIM.SetValue(value: alapSim, index: i); + } + + foreach (SIM item in listaSIM) + { + Console.WriteLine(item.Sorszam); + Console.WriteLine(item.Pinkod); + Console.WriteLine(); + } + + for (int i = 0; i < listaSIM.Length; i++) + { + Console.WriteLine("Kérem adja meg a PIN kódot (3 lehetőség)"); + for (int j = 0; j < 3; j++) + { + listaSIM[i].SimLetiltas(listaSIM[i].Sorszam, listaSIM[i].Pinkod); + if (listaSIM[i].Tudta) + { + break; + } + } + if (listaSIM[i].Tudta) + { + Console.WriteLine("A SIM feloldva"); + } + else + { + Console.WriteLine("A SIM letiltva"); + } + } + + Console.ReadKey(); + } + + static void Main() + { + Console.WriteLine("Milyen típusú SIM kártyákat szeretne létrehozni (Alap -> a / PUK-kóddal rendelkezőt -> p): "); + char valasz = Convert.ToChar(Console.ReadLine()); + eldontes(valasz); + } + } +} + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace hazi_generator +{ + public class SIM + { + public int Sorszam; + public string Pinkod; + public bool Tudta; + public void AlapSim(int Szam) + { + Sorszam = Szam; + + Console.WriteLine($"A {Sorszam} sorszámú SIM aktiválásához adja meg a pinkódot"); + Pinkod = Console.ReadLine(); + if (Pinkod.Length != 4) + { + throw new Exception("A pinkódnak pontosan 4 jegyűnek kell lennie."); + } + else + { + Console.WriteLine("SIM elmentve."); + } + } + + public void SimLetiltas(int sorszam, string pin) + { + Tudta = false; + Console.WriteLine($"Adja meg a {sorszam} sorszámú SIM pink kódját: "); + string beirtPin = Console.ReadLine(); + if (beirtPin != pin) + { + Console.WriteLine("Helytelen PIN kód"); + } + else + { + Tudta = true; + Console.WriteLine("SIM feloldva"); + } + } + } + + public class PUK : SIM + { + public void Puk(string puk) + { + if (!Tudta) + { + Console.WriteLine("Adja meg a PUK kódot:"); + string beirtpuk = Console.ReadLine(); + if (beirtpuk == puk) + { + Tudta = true; + Console.WriteLine("A SIM feloldva, ismét próbálkozhat a PIN kóddal"); + SimLetiltas(Sorszam,Pinkod); + } + else + { + Console.WriteLine("A SIM kártyát megsemmisítettük"); + } + } + } + } +} +