diff --git a/CS_DemoDelegate/.vs/CS_DemoDelegate/v16/.suo b/CS_DemoDelegate/.vs/CS_DemoDelegate/v16/.suo new file mode 100644 index 0000000..485e483 Binary files /dev/null and b/CS_DemoDelegate/.vs/CS_DemoDelegate/v16/.suo differ diff --git a/CS_DemoDelegate/CS_DemoDelegate.sln b/CS_DemoDelegate/CS_DemoDelegate.sln new file mode 100644 index 0000000..cff8030 --- /dev/null +++ b/CS_DemoDelegate/CS_DemoDelegate.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31205.134 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CS_DemoDelegate", "CS_DemoDelegate\CS_DemoDelegate.csproj", "{10E34269-D00D-4EFC-A4A3-FA05640880D3}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DemoLab", "DemoLab\DemoLab.csproj", "{3DB56E6B-40C4-49F0-A3A2-24D3977C17CE}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {10E34269-D00D-4EFC-A4A3-FA05640880D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {10E34269-D00D-4EFC-A4A3-FA05640880D3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {10E34269-D00D-4EFC-A4A3-FA05640880D3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {10E34269-D00D-4EFC-A4A3-FA05640880D3}.Release|Any CPU.Build.0 = Release|Any CPU + {3DB56E6B-40C4-49F0-A3A2-24D3977C17CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3DB56E6B-40C4-49F0-A3A2-24D3977C17CE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3DB56E6B-40C4-49F0-A3A2-24D3977C17CE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3DB56E6B-40C4-49F0-A3A2-24D3977C17CE}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {9A748331-C652-4A74-AA4B-D867D0DC9D00} + EndGlobalSection +EndGlobal diff --git a/CS_DemoDelegate/CS_DemoDelegate/App.config b/CS_DemoDelegate/CS_DemoDelegate/App.config new file mode 100644 index 0000000..193aecc --- /dev/null +++ b/CS_DemoDelegate/CS_DemoDelegate/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/CS_DemoDelegate/CS_DemoDelegate/CS_DemoDelegate.csproj b/CS_DemoDelegate/CS_DemoDelegate/CS_DemoDelegate.csproj new file mode 100644 index 0000000..be859d0 --- /dev/null +++ b/CS_DemoDelegate/CS_DemoDelegate/CS_DemoDelegate.csproj @@ -0,0 +1,59 @@ + + + + + Debug + AnyCPU + {10E34269-D00D-4EFC-A4A3-FA05640880D3} + Exe + CS_DemoDelegate + CS_DemoDelegate + v4.8 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + {3db56e6b-40c4-49f0-a3a2-24d3977c17ce} + DemoLab + + + + \ No newline at end of file diff --git a/CS_DemoDelegate/CS_DemoDelegate/Program.cs b/CS_DemoDelegate/CS_DemoDelegate/Program.cs new file mode 100644 index 0000000..68df4fc --- /dev/null +++ b/CS_DemoDelegate/CS_DemoDelegate/Program.cs @@ -0,0 +1,32 @@ +using System; +using DemoLab; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CS_DemoDelegate +{ + class Myclass + { + + + + public void Process(string data) + { + Console.WriteLine($"{data}! from prcess()!"); + } + } + class Program + { + static void Main(string[] args) + { + Demo d = new Demo(); + Myclass c = new Myclass(); + CallBackDelegate cb = new CallBackDelegate(c.Process); + d.DoSomething(cb); + + Console.ReadKey(); + } + } +} diff --git a/CS_DemoDelegate/CS_DemoDelegate/Properties/AssemblyInfo.cs b/CS_DemoDelegate/CS_DemoDelegate/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..b11f4f6 --- /dev/null +++ b/CS_DemoDelegate/CS_DemoDelegate/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("CS_DemoDelegate")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("CS_DemoDelegate")] +[assembly: AssemblyCopyright("Copyright © 2021")] +[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("10e34269-d00d-4efc-a4a3-fa05640880d3")] + +// 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/CS_DemoDelegate/CS_DemoDelegate/bin/Debug/CS_DemoDelegate.exe b/CS_DemoDelegate/CS_DemoDelegate/bin/Debug/CS_DemoDelegate.exe new file mode 100644 index 0000000..03bd5c6 Binary files /dev/null and b/CS_DemoDelegate/CS_DemoDelegate/bin/Debug/CS_DemoDelegate.exe differ diff --git a/CS_DemoDelegate/CS_DemoDelegate/bin/Debug/CS_DemoDelegate.exe.config b/CS_DemoDelegate/CS_DemoDelegate/bin/Debug/CS_DemoDelegate.exe.config new file mode 100644 index 0000000..193aecc --- /dev/null +++ b/CS_DemoDelegate/CS_DemoDelegate/bin/Debug/CS_DemoDelegate.exe.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/CS_DemoDelegate/CS_DemoDelegate/bin/Debug/CS_DemoDelegate.pdb b/CS_DemoDelegate/CS_DemoDelegate/bin/Debug/CS_DemoDelegate.pdb new file mode 100644 index 0000000..636c4e0 Binary files /dev/null and b/CS_DemoDelegate/CS_DemoDelegate/bin/Debug/CS_DemoDelegate.pdb differ diff --git a/CS_DemoDelegate/CS_DemoDelegate/bin/Debug/DemoLab.dll b/CS_DemoDelegate/CS_DemoDelegate/bin/Debug/DemoLab.dll new file mode 100644 index 0000000..0cad31c Binary files /dev/null and b/CS_DemoDelegate/CS_DemoDelegate/bin/Debug/DemoLab.dll differ diff --git a/CS_DemoDelegate/CS_DemoDelegate/bin/Debug/DemoLab.pdb b/CS_DemoDelegate/CS_DemoDelegate/bin/Debug/DemoLab.pdb new file mode 100644 index 0000000..6aed1a0 Binary files /dev/null and b/CS_DemoDelegate/CS_DemoDelegate/bin/Debug/DemoLab.pdb differ diff --git a/CS_DemoDelegate/CS_DemoDelegate/obj/Debug/.NETFramework,Version=v4.8.AssemblyAttributes.cs b/CS_DemoDelegate/CS_DemoDelegate/obj/Debug/.NETFramework,Version=v4.8.AssemblyAttributes.cs new file mode 100644 index 0000000..15efebf --- /dev/null +++ b/CS_DemoDelegate/CS_DemoDelegate/obj/Debug/.NETFramework,Version=v4.8.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] diff --git a/CS_DemoDelegate/CS_DemoDelegate/obj/Debug/CS_DemoDelegate.csproj.CopyComplete b/CS_DemoDelegate/CS_DemoDelegate/obj/Debug/CS_DemoDelegate.csproj.CopyComplete new file mode 100644 index 0000000..e69de29 diff --git a/CS_DemoDelegate/CS_DemoDelegate/obj/Debug/CS_DemoDelegate.csproj.CoreCompileInputs.cache b/CS_DemoDelegate/CS_DemoDelegate/obj/Debug/CS_DemoDelegate.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..4c3c754 --- /dev/null +++ b/CS_DemoDelegate/CS_DemoDelegate/obj/Debug/CS_DemoDelegate.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +8227bef1327ab62ebfb6b12b632e370618ffb75a diff --git a/CS_DemoDelegate/CS_DemoDelegate/obj/Debug/CS_DemoDelegate.csproj.FileListAbsolute.txt b/CS_DemoDelegate/CS_DemoDelegate/obj/Debug/CS_DemoDelegate.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..d305edc --- /dev/null +++ b/CS_DemoDelegate/CS_DemoDelegate/obj/Debug/CS_DemoDelegate.csproj.FileListAbsolute.txt @@ -0,0 +1,10 @@ +C:\Users\Rajat Kumar\Desktop\Demo c#\CS_DemoDelegate\CS_DemoDelegate\obj\Debug\CS_DemoDelegate.csproj.CoreCompileInputs.cache +C:\Users\Rajat Kumar\Desktop\Demo c#\CS_DemoDelegate\CS_DemoDelegate\bin\Debug\CS_DemoDelegate.exe.config +C:\Users\Rajat Kumar\Desktop\Demo c#\CS_DemoDelegate\CS_DemoDelegate\bin\Debug\CS_DemoDelegate.exe +C:\Users\Rajat Kumar\Desktop\Demo c#\CS_DemoDelegate\CS_DemoDelegate\bin\Debug\CS_DemoDelegate.pdb +C:\Users\Rajat Kumar\Desktop\Demo c#\CS_DemoDelegate\CS_DemoDelegate\bin\Debug\DemoLab.dll +C:\Users\Rajat Kumar\Desktop\Demo c#\CS_DemoDelegate\CS_DemoDelegate\bin\Debug\DemoLab.pdb +C:\Users\Rajat Kumar\Desktop\Demo c#\CS_DemoDelegate\CS_DemoDelegate\obj\Debug\CS_DemoDelegate.csprojAssemblyReference.cache +C:\Users\Rajat Kumar\Desktop\Demo c#\CS_DemoDelegate\CS_DemoDelegate\obj\Debug\CS_DemoDelegate.csproj.CopyComplete +C:\Users\Rajat Kumar\Desktop\Demo c#\CS_DemoDelegate\CS_DemoDelegate\obj\Debug\CS_DemoDelegate.exe +C:\Users\Rajat Kumar\Desktop\Demo c#\CS_DemoDelegate\CS_DemoDelegate\obj\Debug\CS_DemoDelegate.pdb diff --git a/CS_DemoDelegate/CS_DemoDelegate/obj/Debug/CS_DemoDelegate.csprojAssemblyReference.cache b/CS_DemoDelegate/CS_DemoDelegate/obj/Debug/CS_DemoDelegate.csprojAssemblyReference.cache new file mode 100644 index 0000000..507e7d9 Binary files /dev/null and b/CS_DemoDelegate/CS_DemoDelegate/obj/Debug/CS_DemoDelegate.csprojAssemblyReference.cache differ diff --git a/CS_DemoDelegate/CS_DemoDelegate/obj/Debug/CS_DemoDelegate.exe b/CS_DemoDelegate/CS_DemoDelegate/obj/Debug/CS_DemoDelegate.exe new file mode 100644 index 0000000..03bd5c6 Binary files /dev/null and b/CS_DemoDelegate/CS_DemoDelegate/obj/Debug/CS_DemoDelegate.exe differ diff --git a/CS_DemoDelegate/CS_DemoDelegate/obj/Debug/CS_DemoDelegate.pdb b/CS_DemoDelegate/CS_DemoDelegate/obj/Debug/CS_DemoDelegate.pdb new file mode 100644 index 0000000..636c4e0 Binary files /dev/null and b/CS_DemoDelegate/CS_DemoDelegate/obj/Debug/CS_DemoDelegate.pdb differ diff --git a/CS_DemoDelegate/CS_DemoDelegate/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/CS_DemoDelegate/CS_DemoDelegate/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..f982169 Binary files /dev/null and b/CS_DemoDelegate/CS_DemoDelegate/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/CS_DemoDelegate/DemoLab/CallBackDelegate b/CS_DemoDelegate/DemoLab/CallBackDelegate new file mode 100644 index 0000000..b50de67 --- /dev/null +++ b/CS_DemoDelegate/DemoLab/CallBackDelegate @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DemoLab +{ + public class Class1 + { + } +} diff --git a/CS_DemoDelegate/DemoLab/CallBackDelegate.cs b/CS_DemoDelegate/DemoLab/CallBackDelegate.cs new file mode 100644 index 0000000..266dba6 --- /dev/null +++ b/CS_DemoDelegate/DemoLab/CallBackDelegate.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DemoLab +{ + public delegate void CallBackDelegate(string input); + + +} diff --git a/CS_DemoDelegate/DemoLab/Demo.cs b/CS_DemoDelegate/DemoLab/Demo.cs new file mode 100644 index 0000000..4888848 --- /dev/null +++ b/CS_DemoDelegate/DemoLab/Demo.cs @@ -0,0 +1,21 @@ +using System; +using DemoLab; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DemoLab +{ + public class Demo + { + public void DoSomething(CallBackDelegate callBack) + { + Console.WriteLine("hello from DoSomething()!"); + callBack?.Invoke("hello world!"); + Console.WriteLine("DoSomething() Ending!"); + + } + + } +} diff --git a/CS_DemoDelegate/DemoLab/DemoLab.csproj b/CS_DemoDelegate/DemoLab/DemoLab.csproj new file mode 100644 index 0000000..c5d199a --- /dev/null +++ b/CS_DemoDelegate/DemoLab/DemoLab.csproj @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + {3DB56E6B-40C4-49F0-A3A2-24D3977C17CE} + Library + Properties + DemoLab + DemoLab + v4.8 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CS_DemoDelegate/DemoLab/Properties/AssemblyInfo.cs b/CS_DemoDelegate/DemoLab/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..a83280c --- /dev/null +++ b/CS_DemoDelegate/DemoLab/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("DemoLab")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("DemoLab")] +[assembly: AssemblyCopyright("Copyright © 2021")] +[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("3db56e6b-40c4-49f0-a3a2-24d3977c17ce")] + +// 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/CS_DemoDelegate/DemoLab/bin/Debug/DemoLab.dll b/CS_DemoDelegate/DemoLab/bin/Debug/DemoLab.dll new file mode 100644 index 0000000..0cad31c Binary files /dev/null and b/CS_DemoDelegate/DemoLab/bin/Debug/DemoLab.dll differ diff --git a/CS_DemoDelegate/DemoLab/bin/Debug/DemoLab.pdb b/CS_DemoDelegate/DemoLab/bin/Debug/DemoLab.pdb new file mode 100644 index 0000000..6aed1a0 Binary files /dev/null and b/CS_DemoDelegate/DemoLab/bin/Debug/DemoLab.pdb differ diff --git a/CS_DemoDelegate/DemoLab/obj/Debug/.NETFramework,Version=v4.8.AssemblyAttributes.cs b/CS_DemoDelegate/DemoLab/obj/Debug/.NETFramework,Version=v4.8.AssemblyAttributes.cs new file mode 100644 index 0000000..15efebf --- /dev/null +++ b/CS_DemoDelegate/DemoLab/obj/Debug/.NETFramework,Version=v4.8.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] diff --git a/CS_DemoDelegate/DemoLab/obj/Debug/DemoLab.csproj.CoreCompileInputs.cache b/CS_DemoDelegate/DemoLab/obj/Debug/DemoLab.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..50493a0 --- /dev/null +++ b/CS_DemoDelegate/DemoLab/obj/Debug/DemoLab.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +9bd260d265e2ab9aa65c327d0bea5c97c328e88d diff --git a/CS_DemoDelegate/DemoLab/obj/Debug/DemoLab.csproj.FileListAbsolute.txt b/CS_DemoDelegate/DemoLab/obj/Debug/DemoLab.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..b5c9955 --- /dev/null +++ b/CS_DemoDelegate/DemoLab/obj/Debug/DemoLab.csproj.FileListAbsolute.txt @@ -0,0 +1,6 @@ +C:\Users\Rajat Kumar\Desktop\Demo c#\CS_DemoDelegate\DemoLab\obj\Debug\DemoLab.csprojAssemblyReference.cache +C:\Users\Rajat Kumar\Desktop\Demo c#\CS_DemoDelegate\DemoLab\obj\Debug\DemoLab.csproj.CoreCompileInputs.cache +C:\Users\Rajat Kumar\Desktop\Demo c#\CS_DemoDelegate\DemoLab\bin\Debug\DemoLab.dll +C:\Users\Rajat Kumar\Desktop\Demo c#\CS_DemoDelegate\DemoLab\bin\Debug\DemoLab.pdb +C:\Users\Rajat Kumar\Desktop\Demo c#\CS_DemoDelegate\DemoLab\obj\Debug\DemoLab.dll +C:\Users\Rajat Kumar\Desktop\Demo c#\CS_DemoDelegate\DemoLab\obj\Debug\DemoLab.pdb diff --git a/CS_DemoDelegate/DemoLab/obj/Debug/DemoLab.csprojAssemblyReference.cache b/CS_DemoDelegate/DemoLab/obj/Debug/DemoLab.csprojAssemblyReference.cache new file mode 100644 index 0000000..4571f48 Binary files /dev/null and b/CS_DemoDelegate/DemoLab/obj/Debug/DemoLab.csprojAssemblyReference.cache differ diff --git a/CS_DemoDelegate/DemoLab/obj/Debug/DemoLab.dll b/CS_DemoDelegate/DemoLab/obj/Debug/DemoLab.dll new file mode 100644 index 0000000..0cad31c Binary files /dev/null and b/CS_DemoDelegate/DemoLab/obj/Debug/DemoLab.dll differ diff --git a/CS_DemoDelegate/DemoLab/obj/Debug/DemoLab.pdb b/CS_DemoDelegate/DemoLab/obj/Debug/DemoLab.pdb new file mode 100644 index 0000000..6aed1a0 Binary files /dev/null and b/CS_DemoDelegate/DemoLab/obj/Debug/DemoLab.pdb differ diff --git a/CS_DemoDelegate/DemoLab/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/CS_DemoDelegate/DemoLab/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..f7cc1bf Binary files /dev/null and b/CS_DemoDelegate/DemoLab/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/CS_DemoFileIO/.vs/CS_DemoFileIO/v16/.suo b/CS_DemoFileIO/.vs/CS_DemoFileIO/v16/.suo new file mode 100644 index 0000000..a9db35c Binary files /dev/null and b/CS_DemoFileIO/.vs/CS_DemoFileIO/v16/.suo differ diff --git a/CS_DemoFileIO/CS_DemoFileIO.sln b/CS_DemoFileIO/CS_DemoFileIO.sln new file mode 100644 index 0000000..475baf3 --- /dev/null +++ b/CS_DemoFileIO/CS_DemoFileIO.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31205.134 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CS_DemoFileIO", "CS_DemoFileIO\CS_DemoFileIO.csproj", "{FCB81E7E-5A10-49C6-A588-6AD9ECDD35B1}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FCB81E7E-5A10-49C6-A588-6AD9ECDD35B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FCB81E7E-5A10-49C6-A588-6AD9ECDD35B1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FCB81E7E-5A10-49C6-A588-6AD9ECDD35B1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FCB81E7E-5A10-49C6-A588-6AD9ECDD35B1}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {F65FBF5F-CADC-4384-A81D-DD329E93A98A} + EndGlobalSection +EndGlobal diff --git a/CS_DemoFileIO/CS_DemoFileIO/App.config b/CS_DemoFileIO/CS_DemoFileIO/App.config new file mode 100644 index 0000000..193aecc --- /dev/null +++ b/CS_DemoFileIO/CS_DemoFileIO/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/CS_DemoFileIO/CS_DemoFileIO/CS_DemoFileIO.csproj b/CS_DemoFileIO/CS_DemoFileIO/CS_DemoFileIO.csproj new file mode 100644 index 0000000..ef9dd38 --- /dev/null +++ b/CS_DemoFileIO/CS_DemoFileIO/CS_DemoFileIO.csproj @@ -0,0 +1,53 @@ + + + + + Debug + AnyCPU + {FCB81E7E-5A10-49C6-A588-6AD9ECDD35B1} + Exe + CS_DemoFileIO + CS_DemoFileIO + v4.8 + 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/CS_DemoFileIO/CS_DemoFileIO/Program.cs b/CS_DemoFileIO/CS_DemoFileIO/Program.cs new file mode 100644 index 0000000..17ceb66 --- /dev/null +++ b/CS_DemoFileIO/CS_DemoFileIO/Program.cs @@ -0,0 +1,144 @@ +using System; +using System.IO; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CS_DemoFileIO +{ + class Program + { + static void WriteBinaryFile(string data) + { + FileStream stream = new FileStream("SampleBinary.bin", FileMode.Create, FileAccess.Write); + BinaryWriter writer = new BinaryWriter(stream); + try + { + writer.Write(true); + writer.Write(DateTime.Now.ToString()); + writer.Write(1000); + writer.Write(data); + writer.Flush(); + } + catch (IOException ex) + { + + Console.WriteLine(ex.Message); + } + finally + { + writer.Close(); + writer.Dispose(); + stream.Close(); + stream.Dispose(); + + } + + } + + //below program for Read binary file + static void ReadBinaryFile() + { + FileStream stream = new FileStream("SampleBinary.bin", FileMode.Open, FileAccess.Read); + BinaryReader reader = new BinaryReader(stream); + + try + { + Console.WriteLine(reader.ReadBoolean()); + Console.WriteLine(DateTime.Parse(reader.ReadString())); + Console.WriteLine(reader.ReadInt32()); + Console.WriteLine(reader.ReadString()); + + } + catch (IOException ex) + { + + Console.WriteLine(ex.Message); + } + finally + { + reader.Close(); + reader.Dispose(); + stream.Close(); + stream.Dispose(); + + } + + } + + + // below program for writer text file \ + static void WriteTextFile(string data) + { + FileStream stream = new FileStream("SampleTextFile.txt", FileMode.Create, FileAccess.Write); + StreamWriter writer = new StreamWriter(stream); + + try + { + writer.WriteLine(data); + } + catch (IOException ex) + { + + Console.WriteLine(ex.Message); + } + finally + { + writer.Close(); + writer.Dispose(); + stream.Close(); + stream.Dispose(); + } + } + + // below program for read text file + + static void ReadTextFile() + { + FileStream stream = new FileStream("SampleTextFile.txt", FileMode.Open, FileAccess.Read); + StreamReader reader = new StreamReader(stream); + + try + { + string data = reader.ReadToEnd(); + Console.WriteLine(data); + } + catch (IOException ex) + { + + Console.WriteLine(ex.Message); + } + + finally + { + reader.Close(); + reader.Dispose(); + stream.Close(); + stream.Dispose(); + } + } + + static void Main(string[] args) + { + //Console.WriteLine("Enter the input data"); + //string input = Console.ReadLine(); + //WriteBinaryFile(input); + + //ReadBinaryFile(); + + + //Console.WriteLine("Enter the input data:"); + //string input = Console.ReadLine(); + //WriteTextFile(input); + + + ReadTextFile(); + + + Console.ReadKey(); + + + } + } +} diff --git a/CS_DemoFileIO/CS_DemoFileIO/Properties/AssemblyInfo.cs b/CS_DemoFileIO/CS_DemoFileIO/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..27951b5 --- /dev/null +++ b/CS_DemoFileIO/CS_DemoFileIO/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("CS_DemoFileIO")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("CS_DemoFileIO")] +[assembly: AssemblyCopyright("Copyright © 2021")] +[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("fcb81e7e-5a10-49c6-a588-6ad9ecdd35b1")] + +// 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/CS_DemoFileIO/CS_DemoFileIO/bin/Debug/CS_DemoFileIO.exe b/CS_DemoFileIO/CS_DemoFileIO/bin/Debug/CS_DemoFileIO.exe new file mode 100644 index 0000000..6bc2405 Binary files /dev/null and b/CS_DemoFileIO/CS_DemoFileIO/bin/Debug/CS_DemoFileIO.exe differ diff --git a/CS_DemoFileIO/CS_DemoFileIO/bin/Debug/CS_DemoFileIO.exe.config b/CS_DemoFileIO/CS_DemoFileIO/bin/Debug/CS_DemoFileIO.exe.config new file mode 100644 index 0000000..193aecc --- /dev/null +++ b/CS_DemoFileIO/CS_DemoFileIO/bin/Debug/CS_DemoFileIO.exe.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/CS_DemoFileIO/CS_DemoFileIO/bin/Debug/CS_DemoFileIO.pdb b/CS_DemoFileIO/CS_DemoFileIO/bin/Debug/CS_DemoFileIO.pdb new file mode 100644 index 0000000..1ebfc68 Binary files /dev/null and b/CS_DemoFileIO/CS_DemoFileIO/bin/Debug/CS_DemoFileIO.pdb differ diff --git a/CS_DemoFileIO/CS_DemoFileIO/bin/Debug/SampleBinary.bin b/CS_DemoFileIO/CS_DemoFileIO/bin/Debug/SampleBinary.bin new file mode 100644 index 0000000..fcab6e3 Binary files /dev/null and b/CS_DemoFileIO/CS_DemoFileIO/bin/Debug/SampleBinary.bin differ diff --git a/CS_DemoFileIO/CS_DemoFileIO/bin/Debug/SampleTextFile.txt b/CS_DemoFileIO/CS_DemoFileIO/bin/Debug/SampleTextFile.txt new file mode 100644 index 0000000..978e201 --- /dev/null +++ b/CS_DemoFileIO/CS_DemoFileIO/bin/Debug/SampleTextFile.txt @@ -0,0 +1 @@ +Welcome to capgemini diff --git a/CS_DemoFileIO/CS_DemoFileIO/obj/Debug/.NETFramework,Version=v4.8.AssemblyAttributes.cs b/CS_DemoFileIO/CS_DemoFileIO/obj/Debug/.NETFramework,Version=v4.8.AssemblyAttributes.cs new file mode 100644 index 0000000..15efebf --- /dev/null +++ b/CS_DemoFileIO/CS_DemoFileIO/obj/Debug/.NETFramework,Version=v4.8.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] diff --git a/CS_DemoFileIO/CS_DemoFileIO/obj/Debug/CS_DemoFileIO.csproj.CoreCompileInputs.cache b/CS_DemoFileIO/CS_DemoFileIO/obj/Debug/CS_DemoFileIO.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..0c63285 --- /dev/null +++ b/CS_DemoFileIO/CS_DemoFileIO/obj/Debug/CS_DemoFileIO.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +2f1b5aa9ca9324e732c8dc8ad98b9a6b4836d80a diff --git a/CS_DemoFileIO/CS_DemoFileIO/obj/Debug/CS_DemoFileIO.csproj.FileListAbsolute.txt b/CS_DemoFileIO/CS_DemoFileIO/obj/Debug/CS_DemoFileIO.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..79d2097 --- /dev/null +++ b/CS_DemoFileIO/CS_DemoFileIO/obj/Debug/CS_DemoFileIO.csproj.FileListAbsolute.txt @@ -0,0 +1,7 @@ +C:\Users\Rajat Kumar\Desktop\Demo c#\CS_DemoFileIO\CS_DemoFileIO\bin\Debug\CS_DemoFileIO.exe.config +C:\Users\Rajat Kumar\Desktop\Demo c#\CS_DemoFileIO\CS_DemoFileIO\bin\Debug\CS_DemoFileIO.exe +C:\Users\Rajat Kumar\Desktop\Demo c#\CS_DemoFileIO\CS_DemoFileIO\bin\Debug\CS_DemoFileIO.pdb +C:\Users\Rajat Kumar\Desktop\Demo c#\CS_DemoFileIO\CS_DemoFileIO\obj\Debug\CS_DemoFileIO.csprojAssemblyReference.cache +C:\Users\Rajat Kumar\Desktop\Demo c#\CS_DemoFileIO\CS_DemoFileIO\obj\Debug\CS_DemoFileIO.csproj.CoreCompileInputs.cache +C:\Users\Rajat Kumar\Desktop\Demo c#\CS_DemoFileIO\CS_DemoFileIO\obj\Debug\CS_DemoFileIO.exe +C:\Users\Rajat Kumar\Desktop\Demo c#\CS_DemoFileIO\CS_DemoFileIO\obj\Debug\CS_DemoFileIO.pdb diff --git a/CS_DemoFileIO/CS_DemoFileIO/obj/Debug/CS_DemoFileIO.csprojAssemblyReference.cache b/CS_DemoFileIO/CS_DemoFileIO/obj/Debug/CS_DemoFileIO.csprojAssemblyReference.cache new file mode 100644 index 0000000..24df8ab Binary files /dev/null and b/CS_DemoFileIO/CS_DemoFileIO/obj/Debug/CS_DemoFileIO.csprojAssemblyReference.cache differ diff --git a/CS_DemoFileIO/CS_DemoFileIO/obj/Debug/CS_DemoFileIO.exe b/CS_DemoFileIO/CS_DemoFileIO/obj/Debug/CS_DemoFileIO.exe new file mode 100644 index 0000000..6bc2405 Binary files /dev/null and b/CS_DemoFileIO/CS_DemoFileIO/obj/Debug/CS_DemoFileIO.exe differ diff --git a/CS_DemoFileIO/CS_DemoFileIO/obj/Debug/CS_DemoFileIO.pdb b/CS_DemoFileIO/CS_DemoFileIO/obj/Debug/CS_DemoFileIO.pdb new file mode 100644 index 0000000..1ebfc68 Binary files /dev/null and b/CS_DemoFileIO/CS_DemoFileIO/obj/Debug/CS_DemoFileIO.pdb differ diff --git a/CS_DemoFileIO/CS_DemoFileIO/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/CS_DemoFileIO/CS_DemoFileIO/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..95af661 Binary files /dev/null and b/CS_DemoFileIO/CS_DemoFileIO/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ