Click here to Skip to main content
15,884,472 members

Comments by abhilash yelmelwar (Top 8 by date)

abhilash yelmelwar 22-Oct-12 7:59am View    
It's Just Incrementing the Next value...But I need Separate Increment for A1,A2,A3 By selecting Max value
abhilash yelmelwar 7-Aug-12 4:54am View    
ohk...i will try...thank you..
abhilash yelmelwar 6-Aug-12 1:33am View    
no dude my connection was ok...but my downloading is stopped suddenly with out any message
abhilash yelmelwar 6-Aug-12 1:32am View    
im not using any sessions here...
abhilash yelmelwar 6-Aug-12 1:31am View    
hello dave....this is my code..i tihnk we can download rest files using time and date but im not able download files...




using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Net;
using System.IO;

namespace Support
{
public partial class FTP : Form
{

public FTP()
{
InitializeComponent();

}

string filetime = @"E:\FTP photos.txt";
private void Download(string line)
{
FtpWebRequest reqFTP;
try
{

string filepath = @"E:\FTP photos";

//F:\Studentphotos
FileStream outputStream = new FileStream(filepath + "\\" + line, FileMode.Create);

reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri("ftp://" + txtip.Text + "/" + txtupload.Text + "/" + line));
//string str = System.IO.Directory.GetFiles(filepath).ToString();

//System.IO.DirectoryInfo dir = new System.IO.DirectoryInfo(filepath);

//if (File.Exists(filepath + "//" + line))

//string str = File.Exists(filepath).ToString();

System.IO.File.Exists(line);
File.Exists(line);


//if(line==str)

// {

if (File.Exists(filepath))
{
GetFileList();
}
else
{

reqFTP.Method = WebRequestMethods.Ftp.DownloadFile;
reqFTP.UseBinary = true;
reqFTP.Credentials = new NetworkCredential(txtuser.Text, txtpass.Text);

FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse();
Stream ftpStream = response.GetResponseStream();

long cl = response.ContentLength;
int bufferSize = 2048;
int readCount;
byte[] buffer = new byte[bufferSize];

readCount = ftpStream.Read(buffer, 0, bufferSize);
while (readCount > 0)
{
outputStream.Write(buffer, 0, readCount);
readCount = ftpStream.Read(buffer, 0, bufferSize);
}

ftpStream.Close();
outputStream.Close();
response.Close();
// MessageBox.Show("Download Completed");
}
}
//}

catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}

private void Download1(string filePath, string fileName)
{
FtpWebRequest reqFTP;
try
{
//filePath = <<The full path where the file is to be created.>>,
//fileName = <<Name of the file to be created(Need not be the name of the file on FTP server).>>
FileStream outputStream = new FileStream(filePath + "\\" + fileName, FileMode.Create);

reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri("ftp://" + txtip.Text + "/" + txtupload.Text));
reqFTP.Method = WebRequestMethods.Ftp.DownloadFile;
reqFTP.UseBinary = true;
reqFTP.Credentials = new NetworkCredential(txtuser.Text,txtpass.Text);
FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse();
Stream ftpStream = response.GetResponseStream();
long cl = response.ContentLength;
int bufferSize = 2048;
int readCount;
byte[] buffer = new byte[bufferSize];

readCount = ftpStream.Read(buffer, 0, bufferSize);
while (readCount > 0)