msvisual.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Ftp to Unix by VB.Net

 
Post new topic   Reply to topic    msvisual.com Forum Index -> VB Enterprise
Author Message
Peter J, Scania



Joined: 04 Oct 2007
Posts: 2

PostPosted: Fri Sep 07, 2007 10:40 am    Post subject: Ftp to Unix by VB.Net Reply with quote

Hi
I'm trying to find out how to tranfer a file to a ftp-cataloug located in an
UNIX server.

My app is a Win service (without UI).
My user as I logging to the UNIX-server with is pointing to at catalouge like:
'/dfs/shared/sdi/home' and my actual target is like
'/dfs/shared/sdi/dev/job'.

My code looks like:
Dim FTPtarget As String = "nserver/dfs/shared/sdi/dev/job"
Dim FileI As New FileInfo(filename)
Dim UriString As String = "ftp://" + FTPtarget + "/" + FileI.Name
Dim reqFtp As FtpWebRequest

Try
' Creates the FtpWebRequest object
reqFtp = CType(WebRequest.CreateDefault(New Uri(UriString)),
FtpWebRequest)

' Sets the required properties
reqFtp.Credentials = New NetworkCredential(ftpUserId,
ftpPassword)
reqFtp.KeepAlive = False
reqFtp.Method = WebRequestMethods.Ftp.UploadFile
reqFtp.UseBinary = True
reqFtp.ContentLength = FileI.Length

' The buffer size is set to 2kb and defines the streaming
objects
Dim buffLength As Integer = 2048
Dim buff(2048) As Byte
Dim contentLen As Integer
Dim fs As FileStream = FileI.OpenRead()
Dim strm As Stream = reqFtp.GetRequestStream()

I need to move in the Unix directory like this (in cmd window):
cd ..
cd dev
cd job

to pointing to right target catalouge.

But how can I manage this in my one shoot (file transfer) code?

Hopefull for an answer
And thankfull for all help

\Peter

Archived from group: microsoft>public>vb>enterprise
Back to top
View user's profile Send private message
Bob Butler



Joined: 04 Oct 2007
Posts: 1081

PostPosted: Fri Sep 07, 2007 11:02 am    Post subject: Re: Ftp to Unix by VB.Net Reply with quote

"Peter J, Scania" wrote in message @microsoft.com...
> Hi
> I'm trying to find out how to tranfer a file to a ftp-cataloug located in
> an
> UNIX server.
>
> My app is a Win service (without UI).
> My user as I logging to the UNIX-server with is pointing to at catalouge
> like:
> '/dfs/shared/sdi/home' and my actual target is like
> '/dfs/shared/sdi/dev/job'.
>
> My code looks like:
> Dim FTPtarget As String = "nserver/dfs/shared/sdi/dev/job"


--
You need to ask in a newsgroup with "dotnet" in the name. This group is for
VB 6.0 and earlier and does not include VB.Net or VB 200x.
Back to top
View user's profile Send private message
Peter J, Scania



Joined: 04 Oct 2007
Posts: 2

PostPosted: Fri Sep 07, 2007 11:22 am    Post subject: Re: Ftp to Unix by VB.Net Reply with quote

Hi Bob

Thanks!
I missed to change the group.



"Bob Butler" wrote:

> "Peter J, Scania" wrote in message
> @microsoft.com...
> > Hi
> > I'm trying to find out how to tranfer a file to a ftp-cataloug located in
> > an
> > UNIX server.
> >
> > My app is a Win service (without UI).
> > My user as I logging to the UNIX-server with is pointing to at catalouge
> > like:
> > '/dfs/shared/sdi/home' and my actual target is like
> > '/dfs/shared/sdi/dev/job'.
> >
> > My code looks like:
> > Dim FTPtarget As String = "nserver/dfs/shared/sdi/dev/job"
>
>
> --
> You need to ask in a newsgroup with "dotnet" in the name. This group is for
> VB 6.0 and earlier and does not include VB.Net or VB 200x.
>
>

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
VB6 and UNIX Does anyone know of any reasonably close of the VB6 language for UNIX? I've been asked to research the subject of porting some VB6 server-side software to UNIX. However, having a strong history in both camps, all I can see are problems and

LINIX & UNIX OS Weather The VB appliication compatible and can run on UNIX and LINUX OS

VB compatible with Linux & Unix Operating Systems Can i Know Weather The Applications Developed in VB along with the shockWaves and flash can be run in LINUX and UNIX operating systems i need this to test my Vb with flash Application

Compatibilty Of VC++ Applications in LInux,Mac,UNIX,Solaries Can I get the details in regard to the compatibilty of The applications Dveloped in VC++ Weather The Applications Developed in VC++ with WIN platform OS can run in If so Can any one say me the procedures how they are done and if no

unix to dos format i write VB6 program to convert file from unix to dos format, the following is the code: Dim myline As String * 100 Open For Input As #1 Len = Len(myline) Open For Output As #2 Do While Not EOF(1) myline =
Post new topic   Reply to topic    msvisual.com Forum Index -> VB Enterprise All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group