-1
FileInfo 목록의 데이터를 파일로 저장하기 위해 코드를 수정하려고합니다.목록의 내용을 서버의 텍스트 파일에 저장하십시오.
public static void writeToServer(string title, string mystring, string username, string password)
{
// Get the object used to communicate with the server.
FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://XX.XXX.XXX.XX/local/ASPXGENERATED/"+title.Replace(" ","")+".aspx");
request.Method = WebRequestMethods.Ftp.UploadFile;
string skeletonFilled = "";
request.Credentials = new NetworkCredential (username,password);
request.UsePassive = true;
request.UseBinary = true;
request.KeepAlive = false;
// Copy the contents of the file to the request stream.
System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
byte[] bytes = Encoding.GetEncoding("UTF-8").GetBytes(mystring);
Stream requestStream = request.GetRequestStream();
requestStream.Write(bytes, 0, bytes.Length);
requestStream.Close();
}
이 perfecly 작동하지만 내가 그것을 목록이 아닌 문자열로 작동하도록 아이디어의 부족 해요 : 이 내가 텍스트 파일에 문자열을 저장하는 데 사용되는 블록 코드입니다. 내가 사용하고 .NET (V)가 3.5
고마워요. 나는이 트릭에 대해 생각하지 않았다. – Slrg