|
|
المشاركات 3,131 |
+التقييم 1.16 |
تاريخ التسجيل Jun 2019 |
الاقامة الزقازيق |
نظام التشغيل ويندوز 0 |
رقم العضوية 279 |

void CommandsAI
case "@ControlSpell":
{
TOFAN.MohamedAyman.Gui.spell Mido = new MohamedAyman.Gui.spell();
Mido.ShowDialog();
break;
}
namespace TOFAN
{
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Globalization;
using System.IO;
using System.Runtime.InteropServices;
using System.Security;
using System.Text;
public class IniFiles
{
public const int MaxSectionSize = 0x7fff;
private string NetDragon3DIP;
public IniFiles(string path)
{
this.NetDragon3DIP = System.IO.Path.GetFullPath(path);
}
public void DeleteKey(string sectionName, string keyName)
{
if (sectionName == null)
{
throw new ArgumentNullException("sectionName");
}
if (keyName == null)
{
throw new ArgumentNullException("keyName");
}
this.DnySlYqaLh(sectionName, keyName, null);
}
public void DeleteSection(string sectionName)
{
if (sectionName == null)
{
throw new ArgumentNullException("sectionName");
}
this.DnySlYqaLh(sectionName, null, null);
}
private void DnySlYqaLh(string string_1, string string_2, string string_3)
{
if (!Class1.WritePrivateProfileString(string_1, string_2, string_3, this.NetDragon3DIP))
{
throw new Win32Exception();
}
}
public double GetDouble(string sectionName, string keyName, double defaultValue)
{
string str = this.GetString(sectionName, keyName, "");
if ((str == null) || (str.Length == 0))
{
return defaultValue;
}
return Convert.ToDouble(str, CultureInfo.InvariantCulture);
}
public int GetInt16(string sectionName, string keyName, short defaultValue)
{
return Convert.ToInt16(this.GetInt32(sectionName, keyName, defaultValue));
}
public int GetInt32(string sectionName, string keyName, int defaultValue)
{
if (sectionName == null)
{
throw new ArgumentNullException("sectionName");
}
if (keyName == null)
{
throw new ArgumentNullException("keyName");
}
return Class1.GetPrivateProfileInt(sectionName, keyName, defaultValue, this.NetDragon3DIP);
}
public string[] GetKeyNames(string sectionName)
{
string[] strArray;
if (sectionName == null)
{
throw new ArgumentNullException("sectionName");
}
IntPtr ptr = Marshal.AllocCoTaskMem(0x7fff);
try
{
int num = Class1.GetPrivateProfileString_2(sectionName, null, null, ptr, 0x7fff, this.NetDragon3DIP);
strArray = smethod_0(ptr, num);
}
finally
{
Marshal.FreeCoTaskMem(ptr);
}
return strArray;
}
public string[] GetSectionNames()
{
string[] strArray;
IntPtr ptr = Marshal.AllocCoTaskMem(0x7fff);
try
{
int num = Class1.GetPrivateProfileSectionNames(ptr, 0x7fff, this.NetDragon3DIP);
strArray = smethod_0(ptr, num);
}
finally
{
Marshal.FreeCoTaskMem(ptr);
}
return strArray;
}
public Dictionary<string, string> GetSectionValues(string sectionName)
{
List<KeyValuePair<string, string>> sectionValuesAsList = this.GetSectionValuesAsList(sectionName);
Dictionary<string, string> dictionary = new Dictionary<string, string>(sectionValuesAsList.Count);
foreach (KeyValuePair<string, string> pair in sectionValuesAsList)
{
if (!dictionary.ContainsKey(pair.Key))
{
dictionary.Add(pair.Key, pair.Value);
}
}
return dictionary;
}
public List<KeyValuePair<string, string>> GetSectionValuesAsList(string sectionName)
{
string[] strArray;
if (sectionName == null)
{
throw new ArgumentNullException("sectionName");
}
IntPtr ptr = Marshal.AllocCoTaskMem(0x7fff);
try
{
int num2 = Class1.GetPrivateProfileSection(sectionName, ptr, 0x7fff, this.NetDragon3DIP);
strArray = smethod_0(ptr, num2);
}
finally
{
Marshal.FreeCoTaskMem(ptr);
}
List<KeyValuePair<string, string>> list = new List<KeyValuePair<string, string>>(strArray.Length);
for (int i = 0; i < strArray.Length; i++)
{
int index = strArray[i].IndexOf('=');
string key = strArray[i].Substring(0, index);
string str2 = strArray[i].Substring(index + 1, (strArray[i].Length - index) - 1);
list.Add(new KeyValuePair<string, string>(key, str2));
}
return list;
}
public string GetString(string sectionName, string keyName, string defaultValue)
{
if (sectionName == null)
{
throw new ArgumentNullException("sectionName");
}
if (keyName == null)
{
throw new ArgumentNullException("keyName");
}
StringBuilder builder = new StringBuilder(0x7fff);
Class1.GetPrivateProfileString(sectionName, keyName, defaultValue, builder, 0x7fff, this.NetDragon3DIP);
return builder.ToString();
}
private static string[] smethod_0(IntPtr intptr_0, int int_0)
{
if (int_0 == 0)
{
return new string[0];
}
return Marshal.PtrToStringAuto(intptr_0, int_0 - 1).Split(new char[1]);
}
public void WriteValue(string sectionName, string keyName, double value)
{
this.WriteValue(sectionName, keyName, value.ToString(CultureInfo.InvariantCulture));
}
public void WriteValue(string sectionName, string keyName, short value)
{
this.WriteValue(sectionName, keyName, (int)value);
}
public void WriteValue(string sectionName, string keyName, int value)
{
this.WriteValue(sectionName, keyName, value.ToString(CultureInfo.InvariantCulture));
}
public void WriteValue(string sectionName, string keyName, float value)
{
this.WriteValue(sectionName, keyName, value.ToString(CultureInfo.InvariantCulture));
}
public void WriteValue(string sectionName, string keyName, string value)
{
if (sectionName == null)
{
throw new ArgumentNullException("sectionName");
}
if (keyName == null)
{
throw new ArgumentNullException("keyName");
}
if (value == null)
{
throw new ArgumentNullException("value");
}
this.DnySlYqaLh(sectionName, keyName, value);
}
public string Path
{
get
{
return this.NetDragon3DIP;
}
}
[SuppressUnmanagedCodeSecurity]
private static class Class1
{
[DllImport("kernel32.dll", CharSet = CharSet.Auto)]
public static extern int GetPrivateProfileInt(string NetDragon3DIP, string string_1, int int_0, string string_2);
[DllImport("kernel32.dll", CharSet = CharSet.Auto)]
public static extern int GetPrivateProfileSection(string NetDragon3DIP, IntPtr intptr_0, uint uint_0, string string_1);
[DllImport("kernel32.dll", CharSet = CharSet.Auto)]
public static extern int GetPrivateProfileSectionNames(IntPtr intptr_0, uint uint_0, string NetDragon3DIP);
[DllImport("kernel32.dll", CharSet = CharSet.Auto)]
public static extern uint GetPrivateProfileString(string NetDragon3DIP, string string_1, string string_2, StringBuilder stringBuilder_0, int int_0, string string_3);
[DllImport("kernel32.dll", EntryPoint = "GetPrivateProfileString", CharSet = CharSet.Auto)]
public static extern uint GetPrivateProfileString_1(string NetDragon3DIP, string string_1, string string_2, [In, Out] char[] char_0, int int_0, string string_3);
[DllImport("kernel32.dll", EntryPoint = "GetPrivateProfileString", CharSet = CharSet.Auto)]
public static extern int GetPrivateProfileString_2(string NetDragon3DIP, string string_1, string string_2, IntPtr intptr_0, uint uint_0, string string_3);
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern bool WritePrivateProfileString(string NetDragon3DIP, string string_1, string string_2, string string_3);
}
}
}
| الذين يشاهدون محتوى الموضوع الآن : 1 ( الأعضاء 0 والزوار 1) | |
|
| الموضوع | كاتب الموضوع | المنتدى | مشاركات | آخر مشاركة |
| خلي حالة السيرفير في الصفحه بحالة قنصل السورس | Hazem | تطوير سيرفرات كونكر | 4 | 2020-08-27 04:13 AM |
| حل مشكلة ايرور قنصل الي بيجيلك لما الاكونت بينزل ريبورن[Rayzov3] | Rider | تطوير سيرفرات كونكر | 2 | 2019-11-22 05:45 PM |
| شرح التعديل علي الاتاك | Mero | تطوير سيرفرات كونكر | 0 | 2019-04-23 11:51 PM |