IT Log

Record various IT issues and difficulties.

Tag: C#


  • How to Convert String Type to Long Type

    To convert a string type to a long type, follow these steps depending on the programming language you’re using: Java Use Long.parseLong() method: try { String str = "12345"; long num = Long.parseLong(str); System.out.println(num); // Output: 12345 } catch (NumberFormatException e) { e.printStackTrace(); } Python Use the int() function, as long is deprecated in Python…


  • Replacing PPT Templates Using C#

    To replace PowerPoint templates using C#, you can utilize the Microsoft PowerPoint COM Interop assemblies. Here’s a step-by-step guide to achieve this: Step 1: Set Up the Project Add References: In your C# project, add references to Microsoft.Office.Interop.PowerPoint and System.Runtime.InteropServices. These are required for interacting with PowerPoint. Step 2: Create the Template Replacement Functionality using…