本文整理汇总了C#中IniFile.WriteString方法的典型用法代码示例。如果您正苦于以下问题:C# IniFile.WriteString方法的具体用法?C# IniFile.WriteString怎么用?C# IniFile.WriteString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IniFile
的用法示例。
在下文中一共展示了IniFile.WriteString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: button2_Click
private void button2_Click(object sender, EventArgs e)
{
var configFile = new IniFile(System.Environment.CurrentDirectory + @"\newide.conf");
configFile.WriteString("Compiler", "gccSetting", gccSetting);
configFile.WriteString("Compiler", "gxxSetting", gxxSetting);
configFile.WriteString("Compiler", "optimizeSetting", optimizeSetting);
configFile.WriteString("Compiler", "optPrefix", optPrefix);
}
示例2: SaveProfile
public static void SaveProfile()
{
string strPath = AppDomain.CurrentDomain.BaseDirectory;
_file = new IniFile(strPath + "Cfg.ini");
_file.WriteString("CONFIG", "BaudRate", G_BAUDRATE); //写数据,下同
_file.WriteString("CONFIG", "DataBits", G_DATABITS);
_file.WriteString("CONFIG", "StopBits", G_STOP);
_file.WriteString("CONFIG", "G_PARITY", G_PARITY);
}
示例3: gravarDados
/*******************************************************************************************************************************************/
private void gravarDados()
{
try
{
var iniFile = new IniFile("./Config.ini");
iniFile.WriteString("Assunto", "assunto1", txtAssunto1.Text);
iniFile.WriteString("Assunto", "assunto2", txtAssunto2.Text);
iniFile.WriteString("Assunto", "assunto3", txtAssunto3.Text);
MessageBox.Show("Gravado com sucesso!", "Informação", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex)
{
MessageBox.Show("Erro ao gravar dados: " + ex.Message);
}
}
示例4: button3_Click
private void button3_Click(object sender, EventArgs e)
{
var configFile = new IniFile(System.Environment.CurrentDirectory + @"\newide.conf");
folderBrowserDialog1.ShowDialog();
MessageBox.Show("Selected prefix is: " + folderBrowserDialog1.SelectedPath, "Setting saved!");
configFile.WriteString("Compiler", "optPrefix", folderBrowserDialog1.SelectedPath);
label7.Text = configFile.ReadString("Compiler", "optPrefix");
}
示例5: Save
public bool Save()
{
try {
IniFile mpi = new IniFile(FilePath);
mpi.WriteString("info", "title", this.Title);
mpi.WriteString("info", "author", this.Author);
mpi.WriteString("info", "url", this.Url);
mpi.WriteInt("display", "height", this.Height);
mpi.WriteInt("display", "width", this.Width);
mpi.WriteInt("device", "tablet", this.Tablet?1:0);
mpi.Flush();
return true;
} catch {
MessageDialogs ms = new MessageDialogs(MessageDialogs.DialogButtonType.Ok, MainClass.Languages.Translate("error"), MainClass.Languages.Translate("error_save_resolution_file" , FilePath), Gtk.MessageType.Error);
ms.ShowDialog();
return false;
}
}
示例6: button1_Click
private void button1_Click(object sender, EventArgs e)
{
var configFile = new IniFile(System.Environment.CurrentDirectory + @"\newide.conf");
folderBrowserDialog1.ShowDialog();
if (System.IO.File.Exists(folderBrowserDialog1.SelectedPath + @"\bin\gcc.exe"))
{
MessageBox.Show("Selected MingW is: " + folderBrowserDialog1.SelectedPath + "\n\n"
+ "GCC Found!","Found GCC and settings saved!");
configFile.WriteString("Compiler","mingwPrefix", folderBrowserDialog1.SelectedPath);
label1.Text = configFile.ReadString("Compiler","mingwPrefix");
}
else
{
MessageBox.Show("Selected MingW is: " + folderBrowserDialog1.SelectedPath + "\n\n"
+ "GCC Not Found!!!!!!", "GCC NOT FOUND, FAILED!");
}
}
示例7: Main
static void Main(string[] args)
{
IniFile a = new IniFile("abc.ini");
a.Load();
foreach(string str in a.GetAllSectionName() )
{
Console.WriteLine(str);
foreach(string rec in a.GetSectionItemName(str))
{
Console.WriteLine(rec);
}
}
a.WriteString("ghi", "3", "4");
a.Save();
IniFile b = new IniFile("b.ini");
b.WriteString("g", "3", "4");
b.Save();
Console.ReadKey();
}
示例8: OnAddTool
//////////////////////////////////////////////////////////////////////////
private void OnAddTool(object sender, EventArgs e)
{
if (ListTools.SelectedIndex < 0 || ListTools.SelectedIndex > 9) return;
if (!File.Exists(UeIniPath)) return;
if (DialogResult.Yes != MessageBox.Show("Do you really want to replace '" +
ListTools.SelectedItem.ToString() + "' with WME check syntax command?", ParentForm.Text,
MessageBoxButtons.YesNo, MessageBoxIcon.Question)) return;
BackupFile(UeIniPath);
string Caption = "WME Check Syntax";
if(File.Exists(ParentForm.TxtProjectFile.Text))
Caption += " (" + Path.GetFileNameWithoutExtension(ParentForm.TxtProjectFile.Text) + ")";
string Command = "\"" + WmeUtils.CompilerPath + "\" -script \"%F\"";
if(File.Exists(ParentForm.TxtProjectFile.Text))
Command += " -project \"" + ParentForm.TxtProjectFile.Text + "\"";
string Suffix = ListTools.SelectedIndex.ToString();
IniFile Ini = new IniFile(UeIniPath);
Ini.WriteString("Tools", "Tool Menu" + Suffix, "\"" + Caption + "\"");
Ini.WriteString("Tools", "Tool Cmd" + Suffix, "\"" + Command + "\"");
Ini.WriteString("Tools", "Tool Dir" + Suffix, "\"\"");
Ini.WriteString("Tools", "Capture" + Suffix, "1");
Ini.WriteString("Tools", "Capture Mode" + Suffix, "3");
Ini.WriteString("Tools", "WinProg" + Suffix, "0");
Ini.WriteString("Tools", "SaveAllFiles" + Suffix, "0");
Ini.WriteString("Tools", "Save Active File" + Suffix, "1");
Ini.WriteString("Tools", "Show DOS Window" + Suffix, "0");
Ini.WriteString("Tools", "Replace Type" + Suffix, "0");
Ini.WriteString("Tools", "Bitmap Path" + Suffix, "\"\"");
LoadInfo();
}
示例9: HandleUsers
private void HandleUsers(RMSQLiteConnection DB)
{
AddToLog("Importing users");
SQL = "SELECT * FROM UserTbl U INNER JOIN GroupTbl G ON U.GroupID = G.GroupID";
DB.ExecuteReader(SQL);
while (DB.Reader.Read())
{
// UserID, GroupID, RLoginHostID, UserName, Password, RealName, Email, EmailVerification, EmailVerified, RegistrationDate
string AccessLevel = DB.Reader["AccessLevel"].ToString();
string Alias = DB.Reader["UserName"].ToString();
string PasswordSalt = StringUtils.RandomString(100);
string PasswordHash = UserInfo.GetPasswordHash(DB.Reader["Password"].ToString(), PasswordSalt, _PasswordPepper);
string UserId = DB.Reader["UserID"].ToString();
using (IniFile Ini = new IniFile(StringUtils.PathCombine(ProcessUtils.StartupPath, "users", UserInfo.SafeAlias(Alias.ToLower()) + ".ini")))
{
Ini.WriteString("USER", "AccessLevel", AccessLevel);
Ini.WriteString("USER", "Alias", Alias);
Ini.WriteString("USER", "PasswordSalt", PasswordSalt);
Ini.WriteString("USER", "PasswordHash", PasswordHash);
Ini.WriteString("USER", "UserId", UserId);
AddToLog(" - Added Alias = " + Alias);
AddToLog(" AccessLevel = " + AccessLevel);
AddToLog(" PasswordSalt = " + PasswordSalt);
AddToLog(" PasswordHash = " + PasswordHash);
AddToLog(" UserId = " + UserId);
AddToLog("");
}
}
DB.Reader.Close();
}
示例10: HandleLogOffOrOnProcessDotIni
private void HandleLogOffOrOnProcessDotIni(RMSQLiteConnection DB, string offOrOn, string inOrOut)
{
AddToLog("Importing settings for log" + offOrOn + "process.ini");
using (IniFile Ini = new IniFile(StringUtils.PathCombine(ProcessUtils.StartupPath, "config", "log" + offOrOn + "process.ini")))
{
// Erase old sections
string[] Sections = Ini.ReadSections();
foreach (string Section in Sections)
{
Ini.EraseSection(Section);
}
SQL = "SELECT * FROM Log" + inOrOut + "ProcessTbl ORDER BY StepNumber";
DB.ExecuteReader(SQL);
while (DB.Reader.Read())
{
string Name = "Log" + offOrOn + "Process" + DB.Reader["StepNumber"].ToString();
string Action = CommandToAction(DB.Reader["Command"].ToString());
string Parameters = DB.Reader["Parameters"].ToString();
string RequiredAccess = DB.Reader["RequiredAccess"].ToString();
if (Action == DB.Reader["Command"].ToString())
{
AddToLog(" - Ignoring command that no longer exists (" + Action + ")");
}
else
{
// See if we need to add the logon/off process as a door
if (Action == "RunDoor")
{
string[] CommandAndParameters = DB.Reader["Parameters"].ToString().Split(' ');
string Command = CommandAndParameters[0];
string DoorParameters = string.Join(" ", CommandAndParameters, 1, CommandAndParameters.Length - 1);
bool Native = DB.Reader["Command"].ToString() == "EXEC";
using (IniFile DoorIni = new IniFile(StringUtils.PathCombine(ProcessUtils.StartupPath, "doors", GetSafeDoorFileName(Name) + ".ini")))
{
DoorIni.WriteString("DOOR", "Name", Name);
DoorIni.WriteString("DOOR", "Command", Command);
DoorIni.WriteString("DOOR", "Parameters", DoorParameters);
DoorIni.WriteString("DOOR", "Native", Native.ToString());
DoorIni.WriteString("DOOR", "ForceQuitDelay", "5");
DoorIni.WriteString("DOOR", "WindowStyle", "Minimized");
}
AddToLog(" - Added Door = " + Name);
AddToLog(" Command = " + Command);
AddToLog(" Parameters = " + DoorParameters);
AddToLog(" Native = " + Native.ToString());
// Override settings to be used below
Action = "RunDoor";
Parameters = Name;
}
Ini.WriteString(Name, "Name", Name);
Ini.WriteString(Name, "Action", Action);
Ini.WriteString(Name, "Parameters", Parameters);
Ini.WriteString(Name, "RequiredAccess", RequiredAccess);
AddToLog(" - Added Name = " + Name);
AddToLog(" Action = " + Action);
AddToLog(" Parameters = " + Parameters);
AddToLog(" RequiredAccess = " + RequiredAccess);
}
}
DB.Reader.Close();
}
AddToLog("");
}
示例11: HandleGameSrvDotIni
private void HandleGameSrvDotIni(RMSQLiteConnection DB)
{
AddToLog("Importing settings for gamesrv.ini");
using (IniFile Ini = new IniFile(StringUtils.PathCombine(ProcessUtils.StartupPath, "config", "gamesrv.ini")))
{
string BBSName = DB.ExecuteScalar("SELECT Value FROM ConfigTbl WHERE Option = 'BBSName'").ToString();
Ini.WriteString("CONFIGURATION", "BBSName", BBSName);
AddToLog(" - BBSName = " + BBSName);
string SysopName = DB.ExecuteScalar("SELECT Value FROM ConfigTbl WHERE Option = 'SysOpName'").ToString();
string SysopFirstName = SysopName;
string SysopLastName = "";
if (SysopName.Trim().Contains(" "))
{
string[] SysopNameElements = SysopName.Split(' ');
SysopFirstName = SysopNameElements[0];
SysopLastName = string.Join(" ", SysopNameElements, 1, SysopNameElements.Length - 1);
}
Ini.WriteString("CONFIGURATION", "SysopFirstName", SysopFirstName);
AddToLog(" - SysopFirstName = " + SysopFirstName);
Ini.WriteString("CONFIGURATION", "SysopLastName", SysopLastName);
AddToLog(" - SysopLastName = " + SysopLastName);
string SysopEmail = DB.ExecuteScalar("SELECT Value FROM ConfigTbl WHERE Option = 'SysOpEmailAddress'").ToString();
Ini.WriteString("CONFIGURATION", "SysopEmail", SysopEmail);
AddToLog(" - SysopEmail = " + SysopEmail);
int FirstNode = Convert.ToInt32(DB.ExecuteScalar("SELECT Value FROM ConfigTbl WHERE Option = 'FirstNode'"));
int Nodes = Convert.ToInt32(DB.ExecuteScalar("SELECT Value FROM ConfigTbl WHERE Option = 'Nodes'"));
int LastNode = FirstNode + Nodes - 1;
Ini.WriteString("CONFIGURATION", "FirstNode", FirstNode.ToString());
AddToLog(" - FirstNode = " + FirstNode.ToString());
Ini.WriteString("CONFIGURATION", "LastNode", LastNode.ToString());
AddToLog(" - LastNode = " + LastNode.ToString());
string TimePerCall = DB.ExecuteScalar("SELECT MinutesPerCall FROM GroupTbl WHERE GroupID = 2").ToString();
Ini.WriteString("CONFIGURATION", "TimePerCall", TimePerCall);
AddToLog(" - TimePerCall = " + TimePerCall);
string NextUserId = DB.ExecuteScalar("SELECT MAX(UserID) + 1 FROM UserTbl").ToString();
Ini.WriteString("CONFIGURATION", "NextUserId", NextUserId);
AddToLog(" - NextUserId = " + NextUserId);
if (DB.ExecuteScalar("SELECT COUNT(*) FROM ServerThreadTbl WHERE ConnectionType = 2").ToString() != "0")
{
string TelnetServerIP = DB.ExecuteScalar("SELECT LocalAddress FROM ServerThreadTbl WHERE ConnectionType = 2 ORDER BY ServerThreadID LIMIT 1").ToString();
Ini.WriteString("CONFIGURATION", "TelnetServerIP", TelnetServerIP);
AddToLog(" - TelnetServerIP = " + TelnetServerIP);
string TelnetServerPort = DB.ExecuteScalar("SELECT LocalPort FROM ServerThreadTbl WHERE ConnectionType = 2 ORDER BY ServerThreadID LIMIT 1").ToString();
Ini.WriteString("CONFIGURATION", "TelnetServerPort", TelnetServerPort);
AddToLog(" - TelnetServerPort = " + TelnetServerPort);
}
if (DB.ExecuteScalar("SELECT COUNT(*) FROM ServerThreadTbl WHERE ConnectionType = 1").ToString() != "0")
{
string RLoginServerIP = DB.ExecuteScalar("SELECT LocalAddress FROM ServerThreadTbl WHERE ConnectionType = 1 ORDER BY ServerThreadID LIMIT 1").ToString();
Ini.WriteString("CONFIGURATION", "RLoginServerIP", RLoginServerIP);
AddToLog(" - RLoginServerIP = " + RLoginServerIP);
string RLoginServerPort = DB.ExecuteScalar("SELECT LocalPort FROM ServerThreadTbl WHERE ConnectionType = 1 ORDER BY ServerThreadID LIMIT 1").ToString();
Ini.WriteString("CONFIGURATION", "RLoginServerPort", RLoginServerPort);
AddToLog(" - RLoginServerPort = " + RLoginServerPort);
}
_PasswordPepper = (chkPlaintextPasswords.Checked) ? "DISABLE" : StringUtils.RandomString(100);
Ini.WriteString("CONFIGURATION", "PasswordPepper", _PasswordPepper);
AddToLog(" - PasswordPepper = " + _PasswordPepper);
}
AddToLog("");
}
示例12: HandleDoors
private void HandleDoors(RMSQLiteConnection DB)
{
AddToLog("Importing settings for doors.ini");
SQL = "SELECT * FROM MenuTbl WHERE Command IN ('EXEC', 'EXEC_NETFOSS', 'EXEC_MSYNCFOS')";
DB.ExecuteReader(SQL);
while (DB.Reader.Read())
{
string Name = DB.Reader["Description"].ToString();
string[] CommandAndParameters = DB.Reader["Parameters"].ToString().Split(' ');
string Command = CommandAndParameters[0];
string Parameters = string.Join(" ", CommandAndParameters, 1, CommandAndParameters.Length - 1);
bool Native = DB.Reader["Command"].ToString() == "EXEC";
using (IniFile Ini = new IniFile(StringUtils.PathCombine(ProcessUtils.StartupPath, "doors", GetSafeDoorFileName(Name) + ".ini")))
{
Ini.WriteString("DOOR", "Name", Name);
Ini.WriteString("DOOR", "Command", Command);
Ini.WriteString("DOOR", "Parameters", Parameters);
Ini.WriteString("DOOR", "Native", Native.ToString());
Ini.WriteString("DOOR", "ForceQuitDelay", "5");
Ini.WriteString("DOOR", "WindowStyle", "Minimized");
}
AddToLog(" - Added Name = " + Name);
AddToLog(" Command = " + Command);
AddToLog(" Parameters = " + Parameters);
AddToLog(" Native = " + Native.ToString());
}
DB.Reader.Close();
AddToLog("");
}
示例13: Save
/// <summary>
/// Advanced save method that allows you to specify the section to save to
/// </summary>
/// <param name="sectionName">The section to save within the INI</param>
protected void Save(string sectionName)
{
// Load the Ini
IniFile Ini = new IniFile(FileName, IniPassword);
// Loop through each field in the inherited class and write the value to the Ini
PropertyInfo[] Properties = this.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly);
foreach (PropertyInfo Property in Properties)
{
// Ensure we only look at read+write properties (read only helper properties should not be loaded from/saved to an ini)
if ((Property.CanRead) && (Property.CanWrite))
{
switch (Property.PropertyType.Name)
{
case "Boolean":
case "Byte":
case "Char":
case "DateTime":
case "Decimal":
case "Double":
case "Int16":
case "Int32":
case "Int64":
case "SByte":
case "Single":
case "String":
case "UInt16":
case "UInt32":
case "UInt64":
// All the built-in types can be saved via Ini.WriteString()
Ini.WriteString(sectionName, Property.Name, Property.GetValue(this, null).ToString());
break;
case "Boolean[]":
case "Byte[]":
case "Char[]":
case "DateTime[]":
case "Decimal[]":
case "Double[]":
case "Int16[]":
case "Int32[]":
case "Int64[]":
case "SByte[]":
case "Single[]":
case "String[]":
case "UInt16[]":
case "UInt32[]":
case "UInt64[]":
Ini.WriteString(sectionName, Property.Name, (IList)Property.GetValue(this, null));
break;
case "RMSecureString":
// RMSecureString should be saved via Ini.WriteString() either protected or encrypted
if (RMSecureStringPassword.Length == 0)
{
// No password means protected
Ini.WriteString(sectionName, Property.Name, ((RMSecureString)Property.GetValue(this, null)).GetProtectedString(RMSecureStringPassword));
}
else
{
// Password means encrypted
Ini.WriteString(sectionName, Property.Name, ((RMSecureString)Property.GetValue(this, null)).GetEncryptedString(RMSecureStringPassword));
}
break;
case "StringDictionary":
StringDictionary SD = (StringDictionary)Property.GetValue(this, null);
foreach (DictionaryEntry DE in SD)
{
Ini.WriteString(sectionName, Property.Name + "_" + DE.Key.ToString(), DE.Value.ToString());
}
break;
default:
// Check for enum, which we can save the string representation of
if (Property.PropertyType.BaseType.Name == "Array")
{
Ini.WriteString(sectionName, Property.Name, (IList)Property.GetValue(this, null));
}
else if (Property.PropertyType.BaseType.Name == "Enum")
{
Ini.WriteString(sectionName, Property.Name, Property.GetValue(this, null).ToString());
}
break;
}
}
}
// Update the INI files
Ini.Save();
}
示例14: CompilerSetting_Load
private void CompilerSetting_Load(object sender, EventArgs e)
{
if (System.IO.File.Exists(System.Environment.CurrentDirectory + @"\newide.conf"))
{
}
else
{
using (File.Create(System.Environment.CurrentDirectory + @"\newide.conf"));
}
var configFile = new IniFile(System.Environment.CurrentDirectory + @"\newide.conf");
FileInfo fileinfo = new FileInfo(System.Environment.CurrentDirectory + @"\newide.conf");
if (fileinfo.Length != 0)
{
gccSetting = configFile.ReadString("Compiler", "gccSetting");
gxxSetting = configFile.ReadString("Compiler", "gxxSetting");
mingwPrefix = configFile.ReadString("Compiler", "mingwPrefix");
optimizeSetting = configFile.ReadString("Compiler", "optimizeSetting");
optPrefix = configFile.ReadString("Compiler", "optPrefix");
}
else
{
MessageBox.Show("Initial load failed, automatically set GCC prefix to: \n\n " + @"C:\MinGW!" + "\n\n\n" + "...or your configuration may lost, \n please set up your settings then restart NewerIDE again.", "Error");
gccSetting = @"-static-libgcc";
gxxSetting = @"-static-libgcc";
mingwPrefix = @"C:\MinGW";
optimizeSetting = @"-march=core2 -mtune=core2";
optPrefix = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
configFile.WriteString("Compiler", "gccSetting", gccSetting);
configFile.WriteString("Compiler", "gxxSetting", gxxSetting);
configFile.WriteString("Compiler", "mingwPrefix", mingwPrefix);
configFile.WriteString("Compiler", "optimizeSetting", optimizeSetting);
configFile.WriteString("Compiler", "optPrefix", optPrefix);
}
textBox1.AppendText("HuStudio NewerIDE compiler setting tool\n\n");
textBox1.AppendText("Oririnally written by Jackson Ming Hu.\n");
textBox1.AppendText("Version: " + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString() + "\n");
textBox1.AppendText("Processor: " + System.Reflection.Assembly.GetExecutingAssembly().GetName().ProcessorArchitecture.ToString() + "\n");
textBox1.AppendText("Build date: " + System.IO.File.GetLastWriteTime(this.GetType().Assembly.Location) + "\n");
}
示例15: OnAddLanguage
//////////////////////////////////////////////////////////////////////////
private void OnAddLanguage(object sender, EventArgs e)
{
if (!File.Exists(PsPadIni)) return;
//File.Exists(ParentForm.TxtProjectFile.Text
while(NativeMethods.FindWindowEx(IntPtr.Zero, IntPtr.Zero, "TfPSPad", null)!=IntPtr.Zero)
{
DialogResult Res = MessageBox.Show("Please close PSPad first.", ParentForm.Text, MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Error);
if (Res == DialogResult.Abort) return;
else if (Res == DialogResult.Ignore) break;
}
if (DialogResult.Yes != MessageBox.Show("Do you really want to replace '" +
ListLanguages.SelectedItem.ToString() + "' with WME scripts?", ParentForm.Text,
MessageBoxButtons.YesNo, MessageBoxIcon.Question)) return;
IniFile Ini = new IniFile(PsPadIni);
string Suffix = "";
if (ListLanguages.SelectedIndex > 0) Suffix = ListLanguages.SelectedIndex.ToString();
Ini.WriteString("Config", "UserHighLighterName" + Suffix, "WME Script");
Ini.WriteString("Highlighters", "General" + Suffix, "1");
string[] Extensions = ParentForm.GetExtensions();
string Extensions2 = "";
foreach(string Ext in Extensions)
{
if (Extensions2 != "") Extensions2 += ";";
Extensions2 += "*." + Ext;
}
// language section
Ini.WriteString("WME Script", "Filter", "WME Script (" + Extensions2 + ")|" + Extensions2);
Ini.WriteString("WME Script", "HLTabWidth", "4");
Ini.WriteString("WME Script", "IndentChar", "{");
Ini.WriteString("WME Script", "UnIndentChar", "}");
Ini.WriteString("WME Script", "Comment", "000080001FFFFFFF010");
Ini.WriteString("WME Script", "Identifier", "1FFFFFFF1FFFFFFF000");
Ini.WriteString("WME Script", "Key", "00FF00001FFFFFFF100");
Ini.WriteString("WME Script", "Key words 2", "000000801FFFFFFF100");
Ini.WriteString("WME Script", "Key words 3", "008080001FFFFFFF100");
Ini.WriteString("WME Script", "Label", "000000FF1FFFFFFF000");
Ini.WriteString("WME Script", "Number", "000000FF1FFFFFFF000");
Ini.WriteString("WME Script", "Preprocessor", "008000801FFFFFFF010");
Ini.WriteString("WME Script", "Reserved Word", "000000801FFFFFFF100");
Ini.WriteString("WME Script", "Space", "008080001FFFFFFF000");
Ini.WriteString("WME Script", "String", "008080801FFFFFFF000");
Ini.WriteString("WME Script", "Symbol", "1FFFFFFF1FFFFFFF000");
// compiler settings
Ini.WriteString("WME Script", "Compilator File", WmeUtils.CompilerPath);
string CompParams = "-script |%File%|";
if (File.Exists(ParentForm.TxtProjectFile.Text))
CompParams += " -project |" + ParentForm.TxtProjectFile.Text + "|";
Ini.WriteString("WME Script", "Compilator Param", CompParams);
Ini.WriteString("WME Script", "Compilator LOG", "");
Ini.WriteString("WME Script", "Compilator Run", "");
Ini.WriteString("WME Script", "Compilator Help", Path.Combine(WmeUtils.ToolsPath, "wme.chm"));
Ini.WriteString("WME Script", "Compilator SaveAll", "0");
Ini.WriteString("WME Script", "Compilator ParsLog", "%F,%L:%E");
Ini.WriteString("WME Script", "Compilator Capture", "1");
Ini.WriteString("WME Script", "Compilator HideOutput", "1");
Ini.WriteString("WME Script", "Compilator DefaultDir", "");
// generate syntax file
try
{
string SyntaxFilePath = Path.Combine(TxtPsPadInstallDir.Text, "Syntax");
if (!Directory.Exists(SyntaxFilePath)) Directory.CreateDirectory(SyntaxFilePath);
SyntaxFilePath = Path.Combine(SyntaxFilePath, "WME Script.ini");
using (StreamWriter sw = new StreamWriter(SyntaxFilePath, false, Encoding.Default))
{
sw.WriteLine("; PSPad HighLighter definition file for WME Scripts");
sw.WriteLine("; Generated automatically by WME Integrator");
sw.WriteLine("; Do not modify this file");
sw.WriteLine("[Settings]");
sw.WriteLine("Name=WME Script");
sw.WriteLine("HTMLGroup=0");
sw.WriteLine("Label=1");
sw.WriteLine("FileType=" + Extensions2.Replace(";", ","));
sw.WriteLine("CommentString=");
sw.WriteLine("SlashComment=1");
sw.WriteLine("CComment=1");
sw.WriteLine("SlashComment=1");
sw.WriteLine("Preprocessors=1");
sw.WriteLine("IndentChar={");
sw.WriteLine("UnIndentChar=}");
sw.WriteLine("TabWidth=4");
sw.WriteLine("CaseSensitive=1");
sw.WriteLine("DoubleQuote=1");
sw.WriteLine("KeyWordChars=_");
sw.WriteLine("CodeExplorer=ftJS");
WordHolder wh;
//.........这里部分代码省略.........