Hi,
i was referring this article to write a file into FTP server. I run the logic from a button clicked method in a custom form.
From original code in the article, I only changed the ftp server and file name. Here's my code:
public void clicked()
{
TextStreamIo textStreamIO = TextStreamIo::constructForWrite();
System.Text.Encoding getUTF8;
System.IO.StreamReader streamReader;
System.Byte[] bytes;
System.Object request,response,credential;
System.Net.FtpWebRequest ftpRequest;
//System.Net.IWebProxy;
System.IO.Stream requestStream;
System.Net.FtpWebResponse ftpResponse;
Str1260 ftpFileName = "ftp://ftp.dlptest.com" @"/" "hairulFileName.txt";
System.IO.StreamReader reader;
System.Char[] chars;
container con;
System.IO.Stream stream;
;
textStreamIO.writeExp(['Started']);
textStreamIO.writeExp(['This Is Test', ' For Barcode']);
textStreamIO.writeExp(['End']);
stream = textStreamIO.getStream();
stream.Position = 0;
reader = new System.IO.StreamReader(stream);
getUTF8 = System.Text.Encoding::get_UTF8();
bytes = getUTF8.GetBytes(reader.ReadToEnd());
request = System.Net.WebRequest::Create(new System.Uri(ftpFileName));
ftpRequest = request;
credential = new System.Net.NetworkCredential("dlpuser", "rNrKYTX9g7z3RgJRmxWuGHbeu");
ftpRequest.set_Credentials(credential);
ftpRequest.set_ContentLength(bytes.get_Length());
ftpRequest.set_Method("STOR");
ftpRequest.set_Proxy(null);
requestStream = ftpRequest.GetRequestStream();
requestStream.Write(bytes,0,bytes.get_Length());
requestStream.Close();
response = ftpRequest.GetResponse();
ftpResponse = response;
info('Processed.');
}
However, when building the code, I get Reference error like following:

How can i resolve this reference? Thank you.