MediaPortal Forums HTPC/MediaCenter

Go Back   MediaPortal Forum » MediaPortal 1 » Community Skins and Plugins » Plugins


Plugins Plugins developed and maintained by users. Want to create your own plugin? Start a thread in here.

Reply
 
Thread Tools Display Modes
Old 2006-03-30, 22:36   #1 (permalink)
Portal Member
 
Join Date: Mar 2006
Location: Germany
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts


Send a message via ICQ to civicoid
Default PlugIn developing help

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 is offline   Reply With Quote
Old 2006-03-30, 23:02   #2 (permalink)
Portal Member
 
Smirnuff's Avatar
 
Join Date: Dec 2004
Location: United Kingdom
Posts: 630
Thanks: 0
Thanked 2 Times in 1 Post

My System

Default

We can probably give you better help if you explain what you wish to achieve from this piece of code.
Smirnuff is offline   Reply With Quote
Old 2006-03-30, 23:23   #3 (permalink)
Portal Member
 
Join Date: Mar 2006
Location: Germany
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts


Send a message via ICQ to civicoid
Default

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 :-/
civicoid is offline   Reply With Quote
Old 2006-03-30, 23:47   #4 (permalink)
Portal Member
 
Smirnuff's Avatar
 
Join Date: Dec 2004
Location: United Kingdom
Posts: 630
Thanks: 0
Thanked 2 Times in 1 Post

My System

Default

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.
Smirnuff is offline   Reply With Quote
Old 2006-03-31, 09:06   #5 (permalink)
Portal Member
 
Join Date: Mar 2006
Location: Germany
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts


Send a message via ICQ to civicoid
Default

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
civicoid is offline   Reply With Quote
Old 2006-03-31, 13:21   #6 (permalink)
Portal Member
 
Join Date: Mar 2006
Location: Germany
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts


Send a message via ICQ to civicoid
Default

i've done it

thank you for your great support

now i can use my LCDhype more flexible
civicoid is offline   Reply With Quote
Reply

Bookmarks

Tags
developing, plugin

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
IPTV@UT Plugin moiristo Plugins 116 2008-10-06 22:32
(original thread) MCE Replacement Plugin v1.0.0 and-81 MCE Replacement Plugin 532 2007-02-24 00:24
Gathering topical infos about plugins (To: authors & use tomtom21000 Plugins 2 2006-02-05 00:20
Plugin example doesnt show in list Anonymous Plugins 5 2005-08-13 12:12


All times are GMT +1. The time now is 05:04.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 Protected by Akismet Blog with WordPress
Advertisement System V2.6 By   Branden