Wikipedia:Projekt DotNetWikiBot Framework/Innocent timebot/Uppdatering av statistik
Utseende
using System; using System.IO; using System.Text; using System.Text.RegularExpressions; using System.Collections; using System.Xml; using DotNetWikiBot; class MyBot : Bot { public void MyFunction1() { // Write your own function here } /// The entry point function. Start coding here. public static void Main() { Site site = new Site("http://sv.wikisource.org", "Innocent timebot", "********"); Page p = new Page(site, "Wikisource:Korrekturläsning/statistik"); p.LoadEx(); int diff = p.text.IndexOf("{{User:MickeBot/tommall}}"); p.text = p.text.Substring(0 , diff)+"{{byt:User:MickeBot/mall}}"+p.text.Substring(diff+25); p.Save(p.text, "Uppdaterar", true); } }