Post: [C#] Show Log in Console
01-17-2015, 11:52 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); Whats up, I would like to show you my first Post in this section Upside Down Happy
I want to show you today how you can show your users the newest log on Programm start in a Console Upside Down Happy

Code for the ConsoleApplication:

    using System.Text;
using System.Security.Cryptography;
using System.Management;
using Microsoft.Win32;
using System.Globalization;
using System.Net;
using System.IO;

namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
string log = System.IO.File.ReadAllText(@"C:\TeamResQ\log.txt");



Console.WriteLine(log);

Console.Read();
}


Now we create a new C# Project or you paste the Code into your Project.

    
using System.IO;
using System.Net;

private void login_Load(object sender, EventArgs e)
{
if (!File.Exists(@"Log.txt Save Path"))
{
WebClient download = new WebClient();
download.DownloadFile("Link to your ConsoleApplication", @" Console Application Save path");
download.DownloadFile("Link to your log.txt", @"Log.txt save path");
}
else if (File.Exists(@"Log.txt Save Path"))
{
File.Delete(@"Log.txt Save Path");
WebClient download = new WebClient();

download.DownloadFile("Link to your log.txt", @"Log.txt save Path");

System.Diagnostics.Process.Start(@"ConsoleApplication Save Path");
}
}
}


You must login or register to view this content.

You can change your log file how ever you want and it will be downloaded for every user at Programm start Upside Down Happy

I hope you enjoy this Happy Sry for my bad english Happy

The following user thanked GoldPlays for this useful post:

Clay Nation

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo