|
Post by Unicornz on Aug 1, 2008 1:12:46 GMT
how to get text from a file ?
@bulldog
your rules plugin for example pulls the text from an xml file
how do i do that ?
|
|
|
Post by bulldogg on Aug 1, 2008 10:32:11 GMT
to read from a text file first you need to use using System.IO; if you look at the top of the .cs file there should be some already listed, just add that to the bottom. to read from a text file use this code this is from a website showing it as an example to show the text in a console window, so it needs changing this needs changing as it takes date.txt from the location the exe is ran from, but flac is kinda dynamic on that front so it needs to be changed to say grab the txt file from the flac directory in my documents so it now becomes ------ this writes the text to the console which we dont need so we use the privatechat.fire method ----- this was kinda just written off the top of my head. youll have to take it and use it in your own way and put the right code in the right place . if youve got any questins post here or cath me on msn, i think ive got you already on there. i used xml for mine as the layout is better for the user to edit as you have seperate sections. just use google to find some example code and alter it www.google.com/search?client=opera&rls=en&q=read+from+xml+with+c%23&sourceid=opera&ie=utf-8&oe=utf-8 but its XmlDocument you need to read up on BD
|
|
|
Post by Unicornz on Aug 1, 2008 13:45:16 GMT
thanks m8 appreciated
|
|
|
Post by Unicornz on Aug 1, 2008 14:01:03 GMT
ok sorta went ok but i get this Error 1 The type or namespace name 'Textreader' could not be found (are you missing a using directive or an assembly reference?)
|
|
|
Post by bulldogg on Aug 1, 2008 15:36:37 GMT
oh yeah add this
before
TextWriter tw = new StreamWriter("date.txt");
and
at any point after
|
|
|
Post by Unicornz on Aug 1, 2008 18:47:08 GMT
ty now i get Error 1 'FlacPlugIn.Where.TextFileWriter.Main(string[])' must declare a body because it is not marked abstract, extern, or partial
|
|
|
Post by bulldogg on Aug 1, 2008 19:02:51 GMT
send me all ure code in a pm
|
|