public delegate void CheckViewSourceCallback(int idx);
private string CheckNameViewSource(int idx)
{
if (this.listViewSource.InvokeRequired)
{
CheckViewSourceCallback clv = new CheckViewSourceCallback(CheckNameViewSource); //ตรงที่ขึ้น Error
this.Invoke(clv, new object[] { idx });
}
else
{
return (string)listViewSource.Items[idx].Text;
}
}
public delegate void CheckViewDestiCallback(int idx);
private string CheckNameViewDesti(int idx)
{
if (this.listViewDesti.InvokeRequired)
{
CheckViewDestiCallback clv = new CheckViewDestiCallback(CheckNameViewDesti); //ตรงที่ขึ้น Error
this.Invoke(clv, new object[] { idx });
}
else
{
return (string)listViewDesti.Items[idx].Text;
}
}
private void backgroundWorker2_DoWork(object sender, DoWorkEventArgs e)
{
if (listViewDesti.Items.Count == 0)
{
ClAllsync syncCopy = new ClAllsync();
syncCopy.CopyFolder(txtSource.Text, txtDesti.Text);
}
else
{
ClAllsync newCopy = new ClAllsync();
newCopy.CopyNewFiles(txtSource.Text, txtDesti.Text);
for (int i = 0; i < listViewSource.Items.Count; i++)
{
string namefilesource = Path.GetFileName(CheckNameListView(i));//ตรงที่ขึ้น Error
DateTime datename_s = File.GetLastWriteTime(CheckNameListView(i));//ตรงที่ขึ้น Error
for (int j = i; i < listViewDesti.Items.Count; j++)
{
string namefiledest = Path.GetFileName(CheckNameViewDesti(j));
DateTime datename_d = File.GetLastWriteTime(CheckNameViewDesti(j));
if (namefilesource == namefiledest)
{
if (datename_s != datename_d)
{
File.Copy(CheckNameListView(i), CheckNameViewDesti(j), true);//ตรงที่ขึ้น Error
Application.DoEvents();
}
else
{
break;
}
}
else
{
break;
}
break;
}
}
}
}
Error 1 'string Allsync.Form1.CheckNameViewSource(int)' has the wrong return type C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\Allsync\Allsync\Form1.cs 319 47 Allsync
Error 2 'string Allsync.Form1.CheckNameViewDesti(int)' has the wrong return type C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\Allsync\Allsync\Form1.cs 332 46 Allsync
Error 3 The name 'CheckNameListView' does not exist in the current context C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\Allsync\Allsync\Form1.cs 354 62 Allsync
รบกวนพี่ๆแก้ไข Error ให้หน่อยครับ