التحويل ليس صعبا اذا اتبعت قواعد لغة c
وأهمها حالة الأحرف وأقواس المصفوفات[] وأقواس الميثود() والفاصلة المنقوطة;
بالإضافة لمراجعة اسماء الأدوات حرفا وحالة
//Try
try{
//For i As Integer = 0 To DataGridView1.RowCount - 1
for(int i=0; i<DataGridView1.RowCount; i++){
//fes.Navigate().GoToUrl(DataGridView1.Rows(i).Cells(0).Value.ToString())
fes.Navigate().GoToUrl(DataGridView1.Rows[i].Cells[0].Value.ToString());
//title = fes.Title
title = fes.Title;
//If CheckBox1.Checked Then
if (CheckBox1.Checked==true) {
//'System.Threading.Thread.Sleep(10000)
//Dim qqq As IWebElement = fes.FindElement(By.Name("view_photo"))
IWebElement qqq = fes.FindElement(By.Name("view_photo"));
//qqq.Click()
qqq.Click();
//System.Threading.Thread.Sleep(5000)
System.Threading.Thread.Sleep(5000);
//Dim dsd As IWebElement = fes.FindElement(By.XPath("/html/body/div/div/div[2]/div/table/tbody/tr/td/form/div[1]/div/input[1]"))
IWebElement dsd = fes.FindElement(By.XPath(@"/html/body/div/div/div[2]/div/table/tbody/tr/td/form/div[1]/div/input[1]"));
//'dsd.Click()
//System.Threading.Thread.Sleep(2000)
System.Threading.Thread.Sleep(2000);
//dsd.SendKeys(TextBox1.Text)
dsd.SendKeys(TextBox1.Text);
//'SendKeys.SendWait("{Enter}")
//System.Threading.Thread.Sleep(2000)
System.Threading.Thread.Sleep(2000);
//Dim sss As IWebElement = fes.FindElement(By.Name("add_photo_done"))
IWebElement sss = fes.FindElement(By.Name("add_photo_done"));
//sss.Click()
sss.Click();
//System.Threading.Thread.Sleep(20000)
System.Threading.Thread.Sleep(20000);
//Dim postes As IWebElement = fes.FindElement(By.Id("u_0_0"))
IWebElement postes = fes.FindElement(By.Id("u_0_0"));
//Dim postbox As IWebElement = fes.FindElement(By.Name("view_post"))
IWebElement postbox = fes.FindElement(By.Name("view_post"));
//postes.SendKeys(TextBox5.Text)
postes.SendKeys(TextBox5.Text);
//postbox.Click()
postbox.Click();
//Await Task.Delay(CInt(Fix(NumericUpDown1.Value)) * 1000)
Await Task.Delay((int)Math.Truncate(NumericUpDown1.Value) * 1000);
//Else
} else {
//Dim postes As IWebElement = fes.FindElement(By.Id("u_0_0"))
IWebElement postes = fes.FindElement(By.Id("u_0_0"));
//Dim postbox As IWebElement = fes.FindElement(By.Name("view_post"))
IWebElement postbox = fes.FindElement(By.Name("view_post"));
//postes.SendKeys(TextBox5.Text)
postes.SendKeys(TextBox5.Text);
//postbox.Click()
postbox.Click();
//Await Task.Delay(CInt(Fix(NumericUpDown1.Value)) * 1000)
Await Task.Delay((int)Math.Truncate(NumericUpDown1.Value) * 1000)
//End If
}
//Next i
}
//Catch ex As Exception
//End Try
} catch ( Exception ex){
}
التحويل يدوي ويحتمل الأخطاء
وأهمها حالة الأحرف وأقواس المصفوفات[] وأقواس الميثود() والفاصلة المنقوطة;
بالإضافة لمراجعة اسماء الأدوات حرفا وحالة
//Try
try{
//For i As Integer = 0 To DataGridView1.RowCount - 1
for(int i=0; i<DataGridView1.RowCount; i++){
//fes.Navigate().GoToUrl(DataGridView1.Rows(i).Cells(0).Value.ToString())
fes.Navigate().GoToUrl(DataGridView1.Rows[i].Cells[0].Value.ToString());
//title = fes.Title
title = fes.Title;
//If CheckBox1.Checked Then
if (CheckBox1.Checked==true) {
//'System.Threading.Thread.Sleep(10000)
//Dim qqq As IWebElement = fes.FindElement(By.Name("view_photo"))
IWebElement qqq = fes.FindElement(By.Name("view_photo"));
//qqq.Click()
qqq.Click();
//System.Threading.Thread.Sleep(5000)
System.Threading.Thread.Sleep(5000);
//Dim dsd As IWebElement = fes.FindElement(By.XPath("/html/body/div/div/div[2]/div/table/tbody/tr/td/form/div[1]/div/input[1]"))
IWebElement dsd = fes.FindElement(By.XPath(@"/html/body/div/div/div[2]/div/table/tbody/tr/td/form/div[1]/div/input[1]"));
//'dsd.Click()
//System.Threading.Thread.Sleep(2000)
System.Threading.Thread.Sleep(2000);
//dsd.SendKeys(TextBox1.Text)
dsd.SendKeys(TextBox1.Text);
//'SendKeys.SendWait("{Enter}")
//System.Threading.Thread.Sleep(2000)
System.Threading.Thread.Sleep(2000);
//Dim sss As IWebElement = fes.FindElement(By.Name("add_photo_done"))
IWebElement sss = fes.FindElement(By.Name("add_photo_done"));
//sss.Click()
sss.Click();
//System.Threading.Thread.Sleep(20000)
System.Threading.Thread.Sleep(20000);
//Dim postes As IWebElement = fes.FindElement(By.Id("u_0_0"))
IWebElement postes = fes.FindElement(By.Id("u_0_0"));
//Dim postbox As IWebElement = fes.FindElement(By.Name("view_post"))
IWebElement postbox = fes.FindElement(By.Name("view_post"));
//postes.SendKeys(TextBox5.Text)
postes.SendKeys(TextBox5.Text);
//postbox.Click()
postbox.Click();
//Await Task.Delay(CInt(Fix(NumericUpDown1.Value)) * 1000)
Await Task.Delay((int)Math.Truncate(NumericUpDown1.Value) * 1000);
//Else
} else {
//Dim postes As IWebElement = fes.FindElement(By.Id("u_0_0"))
IWebElement postes = fes.FindElement(By.Id("u_0_0"));
//Dim postbox As IWebElement = fes.FindElement(By.Name("view_post"))
IWebElement postbox = fes.FindElement(By.Name("view_post"));
//postes.SendKeys(TextBox5.Text)
postes.SendKeys(TextBox5.Text);
//postbox.Click()
postbox.Click();
//Await Task.Delay(CInt(Fix(NumericUpDown1.Value)) * 1000)
Await Task.Delay((int)Math.Truncate(NumericUpDown1.Value) * 1000)
//End If
}
//Next i
}
//Catch ex As Exception
//End Try
} catch ( Exception ex){
}
التحويل يدوي ويحتمل الأخطاء
