|
|
|
C# WinApp อยากทราบว่า Loop ต่างๆเราสามารถพักแล้วเอามารันต่อวันหน้าได้ไม๊ครับ |
|
|
|
|
|
|
|
ตามหัวข้อเลยครับ
loop แบบนี้ครับ
Code (C#)
static string[] symbol = new string[] { "!", "%", "&", "-", ".", "/", @"\", "_", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "@", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" };
static void SetData()
{
for (int i1 = item[0]; i1 < symbol.Length; i1++)
{
Insert("1", symbol[i1]);
for (int i2 = item[1]; i2 < symbol.Length; i2++)
{
Insert("2", symbol[i1] + symbol[i2]);
for (int i3 = item[2]; i3 < symbol.Length; i3++)
{
Insert("3", symbol[i1] + symbol[i2] + symbol[i3]);
for (int i4 = item[3]; i4 < symbol.Length; i4++)
{
Insert("4", symbol[i1] + symbol[i2] + symbol[i3] + symbol[i4]);
for (int i5 = item[4]; i5 < symbol.Length; i5++)
{
Insert("5", symbol[i1] + symbol[i2] + symbol[i3] + symbol[i4] + symbol[i5]);
for (int i6 = item[5]; i6 < symbol.Length; i6++)
{
Insert("6", symbol[i1] + symbol[i2] + symbol[i3] + symbol[i4] + symbol[i5] + symbol[i6]);
for (int i7 = item[6]; i7 < symbol.Length; i7++)
{
Insert("7", symbol[i1] + symbol[i2] + symbol[i3] + symbol[i4] + symbol[i5] + symbol[i6] + symbol[i7]);
for (int i8 = item[7]; i8 < symbol.Length; i8++)
{
Insert("8", symbol[i1] + symbol[i2] + symbol[i3] + symbol[i4] + symbol[i5] + symbol[i6] + symbol[i7] + symbol[i8]);
for (int i9 = item[8]; i9 < symbol.Length; i9++)
{
Insert("9", symbol[i1] + symbol[i2] + symbol[i3] + symbol[i4] + symbol[i5] + symbol[i6] + symbol[i7] + symbol[i8] + symbol[i9]);
for (int i10 = item[9]; i10 < symbol.Length; i10++)
{
Insert("10", symbol[i1] + symbol[i2] + symbol[i3] + symbol[i4] + symbol[i5] + symbol[i6] + symbol[i7] + symbol[i8] + symbol[i9] + symbol[i10]);
for (int i11 = item[10]; i11 < symbol.Length; i11++)
{
Insert("11", symbol[i1] + symbol[i2] + symbol[i3] + symbol[i4] + symbol[i5] + symbol[i6] + symbol[i7] + symbol[i8] + symbol[i9] + symbol[i10] + symbol[i11]);
for (int i12 = item[11]; i12 < symbol.Length; i12++)
{
Insert("12", symbol[i1] + symbol[i2] + symbol[i3] + symbol[i4] + symbol[i5] + symbol[i6] + symbol[i7] + symbol[i8] + symbol[i9] + symbol[i10] + symbol[i11] + symbol[i12]);
for (int i13 = item[12]; i13 < symbol.Length; i13++)
{
Insert("13", symbol[i1] + symbol[i2] + symbol[i3] + symbol[i4] + symbol[i5] + symbol[i6] + symbol[i7] + symbol[i8] + symbol[i9] + symbol[i10] + symbol[i11] + symbol[i12] + symbol[i13]);
for (int i14 = item[13]; i14 < symbol.Length; i14++)
{
Insert("14", symbol[i1] + symbol[i2] + symbol[i3] + symbol[i4] + symbol[i5] + symbol[i6] + symbol[i7] + symbol[i8] + symbol[i9] + symbol[i10] + symbol[i11] + symbol[i12] + symbol[i13] + symbol[i14]);
for (int i15 = item[14]; i15 < symbol.Length; i15++)
{
Insert("15", symbol[i1] + symbol[i2] + symbol[i3] + symbol[i4] + symbol[i5] + symbol[i6] + symbol[i7] + symbol[i8] + symbol[i9] + symbol[i10] + symbol[i11] + symbol[i12] + symbol[i13] + symbol[i14] + symbol[i15]);
regStatus = i1 + "_" + i2 + "_" + i3 + "_" + i4 + "_" + i5 + "_" + i6 + "_" + i7 + "_" + i8 + "_" + i9 + "_" + i10 + "_" + i11 + "_" + i12 + "_" + i13 + "_" + i14 + "_" + i15;
System.Threading.Thread.Sleep(10);
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
regStatus = complete;
conn1.Close();
cmm = null;
}
Tag : .NET, Win (Windows App), C#, VS 2012 (.NET 4.x), Windows
|
|
|
|
|
|
Date :
2015-12-19 10:43:50 |
By :
lamaka.tor |
View :
853 |
Reply :
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
เคยแต่เก็บลง DB อ่ะครับ
|
|
|
|
|
Date :
2015-12-19 10:48:38 |
By :
weerachai.va |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
นี่ก็เก็บลง DB ครับ
กำลังหัดเขียนโปรแกรมถอดรหัสครับ
Code (C#)
namespace AddPass
{
class Program
{
// public static string digit;
static string[] symbol = new string[] { "!", "%", "&", "-", ".", "/", @"\", "_", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "@", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" };
static System.Data.Odbc.OdbcConnection conn1 = new System.Data.Odbc.OdbcConnection("Dsn=MS Access Database;dbq=C:\\PassWord.mdb;defaultdir=C:;driverid=25;fil=MS Access;maxbuffersize=2048;pagetimeout=5;uid=admin");
static System.Data.Odbc.OdbcCommand cmm = new System.Data.Odbc.OdbcCommand();
#region _reg
static string complete = "#Complete..";
static string KeyRegSetPass = @"HKEY_LOCAL_MACHINE\SOFTWARE\SetPass_ByToR";
static string regStatus
{
get { return Microsoft.Win32.Registry.GetValue(KeyRegSetPass, "SetPassStatus", "").ToString(); }
set { Microsoft.Win32.Registry.SetValue(KeyRegSetPass, "SetPassStatus", (string)value, Microsoft.Win32.RegistryValueKind.String); }
}
#endregion
static List<int> item = new List<int>();
static void Main(string[] args)
{
if (regStatus == string.Empty)
{
regStatus = "0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0";
}
conn1.Open();
cmm.Connection = conn1;
cmm.CommandType = System.Data.CommandType.Text;
if(regStatus == complete) return;
foreach (string s in regStatus.Split('_'))
{
item.Add(int.Parse(s));
}
SetData();
}
static void SetData()
{
for (int i1 = item[0]; i1 < symbol.Length; i1++)
{
Insert("1", symbol[i1]);
for (int i2 = item[1]; i2 < symbol.Length; i2++)
{
Insert("2", symbol[i1] + symbol[i2]);
for (int i3 = item[2]; i3 < symbol.Length; i3++)
{
Insert("3", symbol[i1] + symbol[i2] + symbol[i3]);
for (int i4 = item[3]; i4 < symbol.Length; i4++)
{
Insert("4", symbol[i1] + symbol[i2] + symbol[i3] + symbol[i4]);
for (int i5 = item[4]; i5 < symbol.Length; i5++)
{
Insert("5", symbol[i1] + symbol[i2] + symbol[i3] + symbol[i4] + symbol[i5]);
for (int i6 = item[5]; i6 < symbol.Length; i6++)
{
Insert("6", symbol[i1] + symbol[i2] + symbol[i3] + symbol[i4] + symbol[i5] + symbol[i6]);
for (int i7 = item[6]; i7 < symbol.Length; i7++)
{
Insert("7", symbol[i1] + symbol[i2] + symbol[i3] + symbol[i4] + symbol[i5] + symbol[i6] + symbol[i7]);
for (int i8 = item[7]; i8 < symbol.Length; i8++)
{
Insert("8", symbol[i1] + symbol[i2] + symbol[i3] + symbol[i4] + symbol[i5] + symbol[i6] + symbol[i7] + symbol[i8]);
for (int i9 = item[8]; i9 < symbol.Length; i9++)
{
Insert("9", symbol[i1] + symbol[i2] + symbol[i3] + symbol[i4] + symbol[i5] + symbol[i6] + symbol[i7] + symbol[i8] + symbol[i9]);
for (int i10 = item[9]; i10 < symbol.Length; i10++)
{
Insert("10", symbol[i1] + symbol[i2] + symbol[i3] + symbol[i4] + symbol[i5] + symbol[i6] + symbol[i7] + symbol[i8] + symbol[i9] + symbol[i10]);
for (int i11 = item[10]; i11 < symbol.Length; i11++)
{
Insert("11", symbol[i1] + symbol[i2] + symbol[i3] + symbol[i4] + symbol[i5] + symbol[i6] + symbol[i7] + symbol[i8] + symbol[i9] + symbol[i10] + symbol[i11]);
for (int i12 = item[11]; i12 < symbol.Length; i12++)
{
Insert("12", symbol[i1] + symbol[i2] + symbol[i3] + symbol[i4] + symbol[i5] + symbol[i6] + symbol[i7] + symbol[i8] + symbol[i9] + symbol[i10] + symbol[i11] + symbol[i12]);
for (int i13 = item[12]; i13 < symbol.Length; i13++)
{
Insert("13", symbol[i1] + symbol[i2] + symbol[i3] + symbol[i4] + symbol[i5] + symbol[i6] + symbol[i7] + symbol[i8] + symbol[i9] + symbol[i10] + symbol[i11] + symbol[i12] + symbol[i13]);
for (int i14 = item[13]; i14 < symbol.Length; i14++)
{
Insert("14", symbol[i1] + symbol[i2] + symbol[i3] + symbol[i4] + symbol[i5] + symbol[i6] + symbol[i7] + symbol[i8] + symbol[i9] + symbol[i10] + symbol[i11] + symbol[i12] + symbol[i13] + symbol[i14]);
for (int i15 = item[14]; i15 < symbol.Length; i15++)
{
Insert("15", symbol[i1] + symbol[i2] + symbol[i3] + symbol[i4] + symbol[i5] + symbol[i6] + symbol[i7] + symbol[i8] + symbol[i9] + symbol[i10] + symbol[i11] + symbol[i12] + symbol[i13] + symbol[i14] + symbol[i15]);
regStatus = i1 + "_" + i2 + "_" + i3 + "_" + i4 + "_" + i5 + "_" + i6 + "_" + i7 + "_" + i8 + "_" + i9 + "_" + i10 + "_" + i11 + "_" + i12 + "_" + i13 + "_" + i14 + "_" + i15;
System.Threading.Thread.Sleep(10);
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
regStatus = complete;
conn1.Close();
cmm = null;
}
static void Insert(string _digit, string pass)
{
cmm.CommandText = "INSERT INTO [PassWord1] ([digit], [Pass]) VALUES ('" + _digit + "', '" + pass + "')";
try
{
cmm.ExecuteNonQuery();
}
catch { }
}
}
}
|
|
|
|
|
Date :
2015-12-19 10:51:08 |
By :
lamaka.tor |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
มีแบบที่เก็บไว้ใน DB ไม๊ครับ
อยากจะได้ยลเป็นบุญตาซักตา
|
|
|
|
|
Date :
2015-12-19 11:05:58 |
By :
lamaka.tor |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 00
|