C#.NET
string server = "ftp.example.jp";
string userid = "userid";
string pass = "pass";
TKFP.Net.IFtpLogon logon = new TKFP.Net.BasicFtpLogon(userid, pass);
TKFP.Net.FtpClient ftp = new TKFP.Net.FtpClient(logon, server, 21);
ftp.ConnectionMode = TKFP.Net.ConnectionModes.Passive;
if (ftp.Connect())
{
System.Windows.Forms.MessageBox.Show("接続成功");
System.Console.WriteLine(ftp.SystemName);
}
else
{
System.Windows.Forms.MessageBox.Show("接続失敗");
}
ftp.Close();
VB.NET
C#.NET
string server = "ftp.example.jp";
string userid = "userid";
string pass = "pass";
TKFP.Net.IFtpLogon logon = new TKFP.Net.BasicFtpLogon(userid, pass);
TKFP.Net.FtpClient ftp = new TKFP.Net.FtpClient(logon, server, 21);
ftp.ActiveModeLocalAddress = System.Net.IPAddress.Parse("59.106.13.218");
if (ftp.Connect())
{
System.Windows.Forms.MessageBox.Show("接続成功");
System.Console.WriteLine(ftp.SystemName);
}
else
{
System.Windows.Forms.MessageBox.Show("接続失敗");
}
ftp.Close();
VB.NET
VB.NETのコードはC#.NETを元に「
C#.NET to VB.NET Translator」によって作成したものです