473,467 Members | 2,036 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

C# Ftp client

I am trying to develop C# ftp client to upload files to remote host.
Whenever, I execute System.Net.Sockets.Socket.Connect method, .Net Framework
raises the following exception

Request for the permission of type System.Net.SocketPermission, System,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.

Why does this happen?

Thanks,
-Boris

Nov 16 '05 #1
8 8474
Hi,

This may seems like a silly question, but are you running it from a network
share?

It seems like a permission issue, maybe the user you are running under does
not have enough privilegies

btw, you should use TcpClient instead of Socket, unless you are planning to
use some low level functions.

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Boris" <bo***@crabel.com> wrote in message
news:eI**************@TK2MSFTNGP12.phx.gbl...
I am trying to develop C# ftp client to upload files to remote host.
Whenever, I execute System.Net.Sockets.Socket.Connect method, .Net Framework raises the following exception

Request for the permission of type System.Net.SocketPermission, System,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
Why does this happen?

Thanks,
-Boris

Nov 16 '05 #2
Boris <bo***@crabel.com> wrote:
I am trying to develop C# ftp client to upload files to remote host.
Whenever, I execute System.Net.Sockets.Socket.Connect method, .Net Framework
raises the following exception

Request for the permission of type System.Net.SocketPermission, System,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.

Why does this happen?


Presumably because the machine running the code hasn't given the
assembly the required level of trust.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #3
Boris,

Quite simply, you don't have permission for it to run. Is the code that
this is running from being downloaded from the web, or from a shared drive?
If that is the case, then the default settings would prevent you from
accessing the Socket class.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Boris" <bo***@crabel.com> wrote in message
news:eI**************@TK2MSFTNGP12.phx.gbl...
I am trying to develop C# ftp client to upload files to remote host.
Whenever, I execute System.Net.Sockets.Socket.Connect method, .Net
Framework raises the following exception

Request for the permission of type System.Net.SocketPermission, System,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
failed.

Why does this happen?

Thanks,
-Boris

Nov 16 '05 #4
Hi Ignacio,

Thanks for the response. You are right. I was running it from the network
share, and as soon as I ran it on local machine, it started working.

I am trying to implement FTP client to perform the following tasks

1) Login to remote UNIX server
2) Create appropriate directory, if not already exists
3) Upload the file into the directory
4) Delete file from the directory

Would TcpClient provide me with this functionality? Do you have any code
examples?

Thanks,
-Boris

"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:%2***************@TK2MSFTNGP12.phx.gbl...
Hi,

This may seems like a silly question, but are you running it from a
network
share?

It seems like a permission issue, maybe the user you are running under
does
not have enough privilegies

btw, you should use TcpClient instead of Socket, unless you are planning
to
use some low level functions.

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Boris" <bo***@crabel.com> wrote in message
news:eI**************@TK2MSFTNGP12.phx.gbl...
I am trying to develop C# ftp client to upload files to remote host.
Whenever, I execute System.Net.Sockets.Socket.Connect method, .Net

Framework
raises the following exception

Request for the permission of type System.Net.SocketPermission, System,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

failed.

Why does this happen?

Thanks,
-Boris


Nov 16 '05 #5
Boris,

The TcpClient will only help you in connecting to the FTP server, it
will not help you with issuing the commands for the FTP. You still have to
do that yourself.

However, in .NET 2.0, there is an FtpWebRequest class, which could make
much of it easier (if you can use the beta, and roll out after the release).

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Boris" <bo***@crabel.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi Ignacio,

Thanks for the response. You are right. I was running it from the
network share, and as soon as I ran it on local machine, it started
working.

I am trying to implement FTP client to perform the following tasks

1) Login to remote UNIX server
2) Create appropriate directory, if not already exists
3) Upload the file into the directory
4) Delete file from the directory

Would TcpClient provide me with this functionality? Do you have any code
examples?

Thanks,
-Boris

"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us>
wrote in message news:%2***************@TK2MSFTNGP12.phx.gbl...
Hi,

This may seems like a silly question, but are you running it from a
network
share?

It seems like a permission issue, maybe the user you are running under
does
not have enough privilegies

btw, you should use TcpClient instead of Socket, unless you are planning
to
use some low level functions.

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Boris" <bo***@crabel.com> wrote in message
news:eI**************@TK2MSFTNGP12.phx.gbl...
I am trying to develop C# ftp client to upload files to remote host.
Whenever, I execute System.Net.Sockets.Socket.Connect method, .Net

Framework
raises the following exception

Request for the permission of type System.Net.SocketPermission, System,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

failed.

Why does this happen?

Thanks,
-Boris



Nov 16 '05 #6
Hi,

Thanks for the response. You are right. I was running it from the network share, and as soon as I ran it on local machine, it started working.
Good to know !
Would TcpClient provide me with this functionality? Do you have any code
examples?


TcpClient is a easier way to handle TCP connection, nothing else, you still
have to implement the ftp protocol.

I dont have any code unfortunally, but I'm very sure that if you look into
the archives or online somewhere you will find either a component ready to
be used or an example of how to implement it.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

Nov 16 '05 #7
For finer control, you may want to try
http://www.codeproject.com/dotnet/FTPWinFormClient.asp

Fakher Halim
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:uU**************@tk2msftngp13.phx.gbl...
Hi,

Thanks for the response. You are right. I was running it from the network
share, and as soon as I ran it on local machine, it started working.


Good to know !
Would TcpClient provide me with this functionality? Do you have any code examples?


TcpClient is a easier way to handle TCP connection, nothing else, you

still have to implement the ftp protocol.

I dont have any code unfortunally, but I'm very sure that if you look into
the archives or online somewhere you will find either a component ready to
be used or an example of how to implement it.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

Nov 16 '05 #8
Boris:

Unless writing your own FTP client is a learning excersize, I'd recommend
against re-inventing the wheel, so to speak.

Check out http://www.indyproject.org/indy.html for more information.

Jeff
"Boris" <bo***@crabel.com> wrote in
news:#V**************@TK2MSFTNGP10.phx.gbl:
Hi Ignacio,

Thanks for the response. You are right. I was running it from the
network share, and as soon as I ran it on local machine, it started
working.

I am trying to implement FTP client to perform the following tasks

1) Login to remote UNIX server
2) Create appropriate directory, if not already exists
3) Upload the file into the directory
4) Delete file from the directory

Would TcpClient provide me with this functionality? Do you have any
code examples?

Thanks,
-Boris

"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us>
wrote in message news:%2***************@TK2MSFTNGP12.phx.gbl...
Hi,

This may seems like a silly question, but are you running it from a
network
share?

It seems like a permission issue, maybe the user you are running
under does
not have enough privilegies

btw, you should use TcpClient instead of Socket, unless you are
planning to
use some low level functions.

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Boris" <bo***@crabel.com> wrote in message
news:eI**************@TK2MSFTNGP12.phx.gbl...
I am trying to develop C# ftp client to upload files to remote host.
Whenever, I execute System.Net.Sockets.Socket.Connect method, .Net

Framework
raises the following exception

Request for the permission of type System.Net.SocketPermission,
System, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089

failed.

Why does this happen?

Thanks,
-Boris




Nov 16 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Matt | last post by:
I think this is the basic concept in ASP server-side development. My boss told me web application is NOT client-server application. I argued with him because browser is the client, and the server...
15
by: Michael Rybak | last post by:
hi, everyone. I'm writing a 2-players game that should support network mode. I'm now testing it on 1 PC since I don't have 2. I directly use sockets, and both client and server do...
18
by: cjl | last post by:
Hey all: I know that it is silly in the age of Google to 'lose' something on the internet, but I recently checked out a project that had implemented a database with a subset of SQL in pure...
2
by: Raquel | last post by:
How do I know whether the 'runtime client' and the 'application development client' are installed on my machine? When I issue the command "db2licm -l", it gives the following output: Product...
6
by: Ken Allen | last post by:
I am relatively new to .Net and C#, but I hav ebeen programing in other languages and done some COM work for a number of years. I am attempting to understand how to map an older program...
4
by: rs | last post by:
how I the client tell the server that the socket is closed? or this there an even that informs the server that the clients socket is close? Oh, I am using vb.net 2003 Thanks
2
by: J Huntley Palmer | last post by:
I am having a horrific time integrating uw-imap's c-client for imap support in php. The problem is a whole bunch of "Text relocation remains referenced against symbol" errors during linking....
0
by: khu84 | last post by:
Here is client server very simple code, seems to work with telnet but with with web client code gives blank output. Following is the server code:- <?php function...
2
by: nsaffary | last post by:
hi I hava a client/server program that run correctly when i run it in one computer(local) but when I run client on a one computer and run server run on another, connection does not stablish.(I set...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.