PlugIn developing help (1 Viewer)

civicoid

Portal Member
March 24, 2006
18
0
Germany
is there anybody out there
who can explain me, where i have to put my c# script in my plugin-file so that this routine will work the whole time an writes this code into the text file.



Code:
FileStream file = new FileStream("test1234.txt", FileMode.OpenOrCreate, FileAccess.Write);
StreamWriter sw = new StreamWriter(file);
sw.WriteLine("test");
sw.Close();
file.Close();


I generate a complete script with the tutorial but now i dont know how to continue
 

civicoid

Portal Member
March 24, 2006
18
0
Germany
i want MP to write continuously in the test12345.txt while i can control the value of TEXT

Code:
using System;
using System.IO;
using System.Windows.Forms;
using MediaPortal.GUI.Library;
using MediaPortal.Dialogs;

namespace TestPlugIn
{
    /// <summary>
    /// Summary description for Class1.
    /// </summary>
    public class Class1 : GUIWindow, ISetupForm
   {


        #region ISetupForm Members
        #endregion

        #region GenerateFile

        public static void Start()
        {
            FileStream file = new FileStream("test12345.txt", FileMode.OpenOrCreate, FileAccess.Write);
            StreamWriter sw = new StreamWriter(file);
            sw.WriteLine("TEST");
            sw.Close();
            file.Close();
        }
        #endregion
        
    }

}

sorry but my english is very rusty :-/
 

Smirnuff

Portal Pro
December 7, 2004
630
3
United Kingdom
The Start method will be called once per MP session and the last time I looked the method is called within the main application's thread so you cannot loop within this method. You will need to either create a seperate thread, use timer or take a look at this.
 

civicoid

Portal Member
March 24, 2006
18
0
Germany
mhh,

thank you for your fast replying.
in fact i need this script to write this txt file at start up of MP an then
each minute.

should be a data logger for an other application
 

Users who are viewing this thread

Top Bottom