• Welcome to Forum.Deepsoftware.Com. Please login or sign up.
 

how to use this comments for sending file?

Started by cptang, August 26, 2010, 01:27:25 am

Previous topic - Next topic

cptang

August 26, 2010, 01:27:25 am Last Edit: August 26, 2010, 06:46:22 am by cptang
i use it now,it's better.
i think to use it to send file ã€,
who can give me this demo for bcb6?
my email is cptang@yeah.net
thx!

Roman Novgorodov

Hello

I'm sorry but I don't understand you.

What do you use now? What is better?
What demo do you need? Zmodem or Kermit?

Please make you question more clear.

Roma Novgorodov
DeepSoftware.Com
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

cptang

September 01, 2010, 12:25:50 am #2 Last Edit: September 01, 2010, 12:33:06 am by cptang
Quote from: Roman Novgorodov on August 26, 2010, 04:19:57 pm
Hello

I'm sorry but I don't understand you.

What do you use now? What is better?
What demo do you need? Zmodem or Kermit?

Please make you question more clear.

Roma Novgorodov
DeepSoftware.Com


first, i think u for your replying!

this component is very good!
i like it very much!
i come form china!
i would use this component to send files by serial port.
can you give me this demo for bcb6?  use Zmodem or Kermit .
my email is cptang@yeah.net
thx!

cptang

i do it myself!

code

//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "nrclasses"
#pragma link "nrcomm"
#pragma link "nrdataproc"
#pragma link "nrzmodem"
#pragma link "nrcommbox"
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
    : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button3Click(TObject *Sender)   
{
    nrComm1->ComPortNo = nrDeviceBox1->ItemIndex + 1 ;
    nrComm1->ConfigDialog() ;

    try
    {
        nrComm1->Active = true ;
        StaticText1->Caption = nrComm1->ComName +  "  ok" ;
    }
    catch(...)
    {
        nrComm1->Active = false ;
        StaticText1->Caption = nrComm1->ComName +  "  error" ;
    }
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)   
{
    nrComm1->SendString(Memo1->Text);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)   
{
     if(nrComm1->Active)
        nrComm1->Active = false ;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button5Click(TObject *Sender)       
{
    if(OpenDialog1->Execute())
    {
        try
        {
            nrZModem1->Send(OpenDialog1->FileName);
        }
        catch(...)
        {
            nrZModem1->Abort() ;
        }
    }
}
//---------------------------------------------------------------------------
void __fastcall TForm1::nrComm1AfterReceive(TObject *Com, Pointer Buffer,
      DWORD Received)
{
    if(nrZModem1->ModemState == msListen)
        Memo2->Lines->Add((char*)Buffer)  ;
}
//---------------------------------------------------------------------------