* unimarc
1. 팩스전송 완료. TODOLIST 1. 팩스로 전송될 엑셀파일 밑작업
This commit is contained in:
@@ -1125,52 +1125,6 @@ namespace WindowsFormsApp1
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
string ip = "testftp.barobill.co.kr";
|
||||
string port = "9031";
|
||||
string id = "gloriabook";
|
||||
string pw = "gloria7300";
|
||||
string FilePath = string.Empty;
|
||||
|
||||
OpenFileDialog Odig = openFileDialog1;
|
||||
Odig.Filter = "Excel Files(*.xls)|*.xls|All FIles(*.*)|*.*";
|
||||
Odig.Title = "파일을 선택해주세요.";
|
||||
|
||||
if (Odig.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
FilePath = Odig.FileName;
|
||||
}
|
||||
|
||||
string filename = Path.GetFileName(FilePath);
|
||||
FilePath = Path.GetDirectoryName(FilePath);
|
||||
|
||||
FTP ftp = new FTP();
|
||||
|
||||
// TODO: openFileDialog 사용. 파일경로 가져와야함.
|
||||
|
||||
bool result = ftp.ConnectToServer(ip, port, id, pw);
|
||||
string path = @"DATA";
|
||||
DirectoryInfo dirInfo = new DirectoryInfo(FilePath);
|
||||
FileInfo[] infos = dirInfo.GetFiles();
|
||||
|
||||
if (result == true)
|
||||
{
|
||||
foreach(FileInfo info in dirInfo.GetFiles())
|
||||
{
|
||||
if (Path.GetExtension(info.Name) == ".xls")
|
||||
{
|
||||
if(ftp.UpLoad(path, info.FullName) == false)
|
||||
{
|
||||
MessageBox.Show("FTP Upload 실패");
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("FTP Upload 성공");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else { MessageBox.Show("접속 실패"); }
|
||||
}
|
||||
|
||||
private void button2_Click(object sender, EventArgs e)
|
||||
@@ -1181,8 +1135,54 @@ namespace WindowsFormsApp1
|
||||
|
||||
private void button3_Click(object sender, EventArgs e)
|
||||
{
|
||||
string FilePath = string.Empty;
|
||||
string filename = string.Empty;
|
||||
|
||||
OpenFileDialog Odig = openFileDialog1;
|
||||
Odig.Filter = "Excel Files(*.xls)|*.xls|Excel Files(*.xlsx)|*.xlsx|All FIles(*.*)|*.*";
|
||||
Odig.Title = "엑셀파일을 선택해주세요.";
|
||||
|
||||
if (Odig.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
FilePath = Odig.FileName;
|
||||
filename = Path.GetFileName(FilePath);
|
||||
FilePath = Path.GetDirectoryName(FilePath);
|
||||
if (Path.GetExtension(filename) != ".xls" && Path.GetExtension(filename) != ".xlsx")
|
||||
{
|
||||
MessageBox.Show("엑셀파일만 적용이 가능합니다! | " + Path.GetExtension(filename));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
FTP ftp = new FTP();
|
||||
|
||||
// TODO: openFileDialog 사용. 파일경로 가져와야함.
|
||||
|
||||
bool result = ftp.ConnectToServer();
|
||||
string path = @"";
|
||||
DirectoryInfo dirInfo = new DirectoryInfo(FilePath);
|
||||
FileInfo[] infos = dirInfo.GetFiles();
|
||||
|
||||
if (result == true)
|
||||
{
|
||||
foreach(FileInfo info in dirInfo.GetFiles())
|
||||
{
|
||||
if(Path.GetFileName(info.Name) == filename)
|
||||
{
|
||||
if(ftp.UpLoad(path, info.FullName) == false) {
|
||||
MessageBox.Show("FTP Upload 실패");
|
||||
}
|
||||
else {
|
||||
MessageBox.Show("FTP Upload 성공");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else { MessageBox.Show("접속 실패"); }
|
||||
|
||||
// 바로빌 FAX API연동
|
||||
Barobill_FAX fax = new Barobill_FAX();
|
||||
fax.Send_BaroFax();
|
||||
fax.Send_BaroFax(filename);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user