NC Clone
Moderator: Rathinagiri
- AUGE_OHR
- Posts: 2064
- Joined: Sun Aug 25, 2019 3:12 pm
- DBs Used: DBF, PostgreSQL, MySQL, SQLite
- Location: Hamburg, Germany
Re: NC Clone
hi,
have fix Modi Stru Problem and add Port to HbFTP latest Version v1.26
32 Bit 64 Bit
have also update Source on Github
known Problem : when start HBFM64.EXE 1st time it take much time ...
does not happen with 32 BIT App
have fix Modi Stru Problem and add Port to HbFTP latest Version v1.26
32 Bit 64 Bit
have also update Source on Github
known Problem : when start HBFM64.EXE 1st time it take much time ...
does not happen with 32 BIT App
Last edited by AUGE_OHR on Thu Sep 10, 2020 6:10 am, edited 2 times in total.
have fun
Jimmy
Jimmy
- danielmaximiliano
- Posts: 2612
- Joined: Fri Apr 09, 2010 4:53 pm
- Location: Argentina
- Contact:
Re: NC Clone
Hi jimmy :
remembering the use of HBTIP since I did Email examples I had checked the tUrl class that returns an oUrl object, this class receives a cUrl text containing the following fields this kind of returns to itself
This object can return incorrect as indicated here, it can behave well with domains such as example.org but wrongly before IP addresses like 192.168.1.39
study tUrl class
It is a mistake to create an object and then send it to build another object without the proper consistency.
I suggest you try the following code to eliminate that IP address or domain error
remembering the use of HBTIP since I did Email examples I had checked the tUrl class that returns an oUrl object, this class receives a cUrl text containing the following fields this kind of returns to itself
Code: Select all
METHOD New( cUrl ) CLASS TUrl
::SetAddress( cUrl )
RETURN Self
study tUrl class
Code: Select all
METHOD SetAddress( cUrl ) CLASS TUrl
LOCAL aMatch, cServer, cPath
IF ! HB_ISSTRING( cUrl )
RETURN .F.
ENDIF
::cAddress := cUrl
::cProto := ""
::cUserid := ""
::cPassword := ""
::cServer := ""
::cPath := ""
::cQuery := ""
::cFile := ""
::nPort := -1
IF cUrl == ""
RETURN .T.
ENDIF
// Top-level URL parsing. May fail. <----- HERE
IF Empty( aMatch := hb_regex( ::cREuri, cUrl ) )
RETURN .F.
ENDIF
::cProto := Lower( aMatch[ 2 ] )
cServer := aMatch[ 3 ]
cPath := aMatch[ 4 ]
::cQuery := aMatch[ 5 ]
// server parsing (never fails)
aMatch := hb_regex( ::cREServ, cServer )
::cUserId := aMatch[ 2 ]
::cPassword := aMatch[ 3 ]
::cServer := aMatch[ 4 ]
::nPort := Val( aMatch[ 5 ] )
IF ::nPort < 1
::nPort := -1
ENDIF
// Parse path and file (never fails)
aMatch := hb_regex( ::cREFile, cPath )
::cPath := aMatch[ 2 ]
::cFile := aMatch[ 3 ]
RETURN .T.
METHOD BuildAddress() CLASS TUrl
LOCAL cRet := ""
IF ::cProto != NIL
::cProto := Lower( ::cProto )
ENDIF
IF ! Empty( ::cProto ) .AND. ! ::cServer == ""
cRet := ::cProto + "://"
ENDIF
IF ! ::cUserid == ""
cRet += ::cUserid
IF ! ::cPassword == ""
cRet += ":" + ::cPassword
ENDIF
cRet += "@"
ENDIF
IF ! ::cServer == ""
cRet += ::cServer
IF ::nPort > 0
cRet += ":" + hb_ntos( ::nPort )
ENDIF
ENDIF
IF ::cPath == "" .OR. ! Right( ::cPath, 1 ) == "/"
::cPath += "/"
ENDIF
cRet += ::cPath + ::cFile
IF ! ::cQuery == ""
cRet += "?" + ::cQuery
ENDIF
RETURN iif( cRet == "", NIL, ::cAddress := cRet )
Code: Select all
oUrl := tURL() :New( cUrl )
IF EMPTY( oUrl )
RETURN nil
ENDIF
oClient := TIpClientFtp() :new( oUrl, Sites->Log ) // PARAM .T. TO LOG
IF EMPTY( oClient )
RETURN nil
ENDIF
oClient:nConnTimeout := 2000
oClient:bUsePasv := .T.
I suggest you try the following code to eliminate that IP address or domain error
Code: Select all
STATIC FUNCTION ftpConnect()
LOCAL bError := ERRORBLOCK( { | oErr | BREAK( oErr ) } )
LOCAL lConnect := .F.
LOCAL cUser := sites->user
LOCAL cPassWord := desencri( sites->password )
LOCAL cServer := sites->address
LOCAL cUrl
cUrl := "ftp://" + ALLTRIM( cUser ) + ":" + ALLTRIM( cPassWord ) + "@" + ALLTRIM( cServer )
oUrl := tURL() :New( cUrl )
IF EMPTY( oUrl )
RETURN nil
ENDIF
oUrl:cProto := "ftp://"
oUrl:cServer := cServer
oUrl:cUserId := sites->user
oUrl:cPassword := adesencri( sites->password )
oUrl:nPort := sites->port // Numeric
BEGIN SEQUENCE
oClient := TIpClientFtp() :new( oUrl, Sites->Log ) // PARAM .T. TO LOG
RECOVER
MsgBox('can not Open() the connection, try again ' , 'Attention message' )
Return nil
END
oClient:nConnTimeout := 2000
oClient:bUsePasv := .T.
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
- AUGE_OHR
- Posts: 2064
- Joined: Sun Aug 25, 2019 3:12 pm
- DBs Used: DBF, PostgreSQL, MySQL, SQLite
- Location: Hamburg, Germany
Re: NC Clone
hi,
i have try that Code but end up in RECOVER
so i reduce it to
and now i got Connect again
hm ... perhaps i need to fill default Value to 21 as you say.
it is a good Idea using BEGIN SEQUENCEdanielmaximiliano wrote: ↑Thu Sep 10, 2020 2:41 am I suggest you try the following code to eliminate that IP address or domain errorCode: Select all
cUrl := "ftp://" + ALLTRIM( cUser ) + ":" + ALLTRIM( cPassWord ) + "@" + ALLTRIM( cServer ) oUrl := tURL() :New( cUrl ) IF EMPTY( oUrl ) RETURN nil ENDIF oUrl:cProto := "ftp://" oUrl:cServer := cServer oUrl:cUserId := sites->user oUrl:cPassword := adesencri( sites->password ) oUrl:nPort := sites->port // Numeric BEGIN SEQUENCE oClient := TIpClientFtp() :new( oUrl, Sites->Log ) // PARAM .T. TO LOG RECOVER MsgBox('can not Open() the connection, try again ' , 'Attention message' ) Return nil END oClient:nConnTimeout := 2000 oClient:bUsePasv := .T.
i have try that Code but end up in RECOVER
so i reduce it to
Code: Select all
IF !EMPTY( nPort )
oURL:nPort := nPort
ENDIF
hm ... perhaps i need to fill default Value to 21 as you say.
have fun
Jimmy
Jimmy
- AUGE_OHR
- Posts: 2064
- Joined: Sun Aug 25, 2019 3:12 pm
- DBs Used: DBF, PostgreSQL, MySQL, SQLite
- Location: Hamburg, Germany
Re: NC Clone
latest Version v1.27
32 Bit 64 Bit fixed :
fixed Thumbs ImageRelease "SlideTime"
fixed SumatraPDF Filename with Space
new :
HbFTP : default Port := 21
32 Bit 64 Bit fixed :
fixed Thumbs ImageRelease "SlideTime"
fixed SumatraPDF Filename with Space
new :
HbFTP : default Port := 21
have fun
Jimmy
Jimmy
- danielmaximiliano
- Posts: 2612
- Joined: Fri Apr 09, 2010 4:53 pm
- Location: Argentina
- Contact:
Re: NC Clone
Hi Jimmy: download from the NC clone version, I could recover the \RES folder and compile, I would need the 32 and 64 bit libs that it uses and in that way to be able to correctly execute NC clone, in that way to be able to modify the FTP option of the Same.AUGE_OHR wrote: ↑Wed Aug 26, 2020 8:54 pm
! Note : Source Code is avaiable under https://github.com/AugeOhr/HBFM
(no Image include in Source)
From already thank you very much
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
- AUGE_OHR
- Posts: 2064
- Joined: Sun Aug 25, 2019 3:12 pm
- DBs Used: DBF, PostgreSQL, MySQL, SQLite
- Location: Hamburg, Germany
Re: NC Clone
hi,
http://www.hmgforum.com/viewtopic.php?f ... 7&start=23
Code for Libxlsxwriter is still include but as i´m not able to generate 64 Bit DLL / LIB it is not active
ADO must be installed as ActiveX but have no LIB to include
---
what do you want to modify SFTP ...
64 Bit DLL / Lib of FreeImage is found in this Thread.danielmaximiliano wrote: ↑Tue Sep 22, 2020 1:21 am Hi Jimmy: download from the NC clone version, I could recover the \RES folder and compile, I would need the 32 and 64 bit libs that it uses and in that way to be able to correctly execute NC clone, in that way to be able to modify the FTP option of the Same.
http://www.hmgforum.com/viewtopic.php?f ... 7&start=23
Code for Libxlsxwriter is still include but as i´m not able to generate 64 Bit DLL / LIB it is not active
ADO must be installed as ActiveX but have no LIB to include
---
what do you want to modify SFTP ...
have fun
Jimmy
Jimmy
- danielmaximiliano
- Posts: 2612
- Joined: Fri Apr 09, 2010 4:53 pm
- Location: Argentina
- Contact:
Re: NC Clone
Hi Jimmy:
As we see after general the Url when trying to connect the application remains frozen for a while until it gives an error since the URL is wrong .. that occurs when using IP addresses type B or C
As we see after general the Url when trying to connect the application remains frozen for a while until it gives an error since the URL is wrong .. that occurs when using IP addresses type B or C
Code: Select all
STATIC FUNCTION ftpConnect()
LOCAL bError
LOCAL lConnect := .F.
LOCAL cUser := sites->user
LOCAL cPassWord := desencri( sites->password )
LOCAL cServer := sites->address
LOCAL nPort := sites->Port
LOCAL cUrl, oError
cUrl := "ftp://" + ALLTRIM( cUser ) + ":" + ALLTRIM( cPassWord ) + "@" + ALLTRIM( cServer ) + STR ( nPort )
oUrl := tURL() :New( cUrl )
IF EMPTY( oUrl )
RETURN nil
else
msgbox( oUrl:cAddress,"Entro" )
ENDIF
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
- AUGE_OHR
- Posts: 2064
- Joined: Sun Aug 25, 2019 3:12 pm
- DBs Used: DBF, PostgreSQL, MySQL, SQLite
- Location: Hamburg, Germany
Re: NC Clone
hi,
please get latest Source from GitHub and look into HBFTP.PRG if it work for you
https://github.com/AugeOhr/HBFM
i just have test it with Port 21
i have add Port in v1.26danielmaximiliano wrote: ↑Tue Sep 22, 2020 8:07 pm As we see after general the Url when trying to connect the application remains frozen for a while until it gives an error since the URL is wrong .. that occurs when using IP addresses type B or C
please get latest Source from GitHub and look into HBFTP.PRG if it work for you
https://github.com/AugeOhr/HBFM
i just have test it with Port 21
have fun
Jimmy
Jimmy
- danielmaximiliano
- Posts: 2612
- Joined: Fri Apr 09, 2010 4:53 pm
- Location: Argentina
- Contact:
Re: NC Clone
Hi Jimmy, the port addition in FTP applications is to place the service on another port than the default one. as being Android that its FTP service is port 21; in this case, any other app cannot use port 21 as it is busy. that's why File Manager uses another one manually, in my case the 8556AUGE_OHR wrote: ↑Tue Sep 22, 2020 8:36 pm i have add Port in v1.26
please get latest Source from GitHub and look into HBFTP.PRG if it work for you
https://github.com/AugeOhr/HBFM
i just have test it with Port 21
-----------------------------------------------------------------------------------------------------------------------------------------------------------
HBtip by default assumes port 21 for FTP services that you can check in C:\Harbour\contrib\hbtip\ftpcli.prg
Code: Select all
METHOD New( oUrl, xTrace, oCredentials ) CLASS TIPClientFTP
::super:new( oUrl, iif( hb_defaultValue( xTrace, .F. ), "ftp", xTrace ), oCredentials )
::nDefaultPort := 21
::nConnTimeout := 3000
::nAccessMode := TIP_RW // a read-write protocol
::nDefaultSndBuffSize := ::nDefaultRcvBuffSize := 65536
// precompilation of regex for better prestations
::RegBytes := hb_regexComp( "\(([0-9]+)[ )a-zA-Z]" )
::RegPasv := hb_regexComp( "([0-9]*) *, *([0-9]*) *, *([0-9]*) *, *([0-9]*) *, *([0-9]*) *, *([0-9]*)" )
RETURN Self
that the port is never added, in case the port is different, it should be able to change in the case that I requested for NC clone.
I am going to review this inconvenience that is within HBTIP to set up an IP address correctly in case of being internal class C networks such as 192.168.1.1
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
- AUGE_OHR
- Posts: 2064
- Joined: Sun Aug 25, 2019 3:12 pm
- DBs Used: DBF, PostgreSQL, MySQL, SQLite
- Location: Hamburg, Germany
Re: NC Clone
hi,
it seem there is a big BUG in HBFM since v1.17
after delete a File HBFM does not work correct with F3/F4 and show "black" Window or "no Image" etc.
it seem there is a big BUG in HBFM since v1.17
after delete a File HBFM does not work correct with F3/F4 and show "black" Window or "no Image" etc.
have fun
Jimmy
Jimmy