469,963 Members | 1,885 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,963 developers. It's quick & easy.

files client

Hello,
is it possible to access client files in VB.NET?
What?
I have doing that but it isn't good (VB.NET take file on pc server and not
on pc client):
(thanks)
Dim fichier As StreamReader

Dim name As String

fichier = File.OpenText("C:\liste.txt")

name = fichier.ReadLine()

Response.Write(name)

Do While Not name Is Nothing

name = fichier.ReadLine()

Response.Write(name)

Loop

fichier.Close()
Nov 17 '05 #1
2 1872
Found via Google:

From: Microsoft® Scripting Library - FileSystemObject
.....
Because use of the FSO on the client side raises serious security issues
about providing potentially unwelcome access to a client's local file
system, this documentation assumes use of the FSO object model to create
scripts executed by Internet Web pages on the server side. Since the server
side is used, the Internet Explorer default security settings do not allow
client-side use of the FileSystemObject object. Overriding those defaults
could subject a local computer to unwelcome access to the file system, which
could result in total destruction of the file system's integrity, causing
loss of data, or worse
....
Use of the FSO is possible client-side in IE, provided the user has set
"enable objects not marked as safe for scripting" (or words to that
effect) to "allow" or "prompt".
James
"cedced" <ce********@yahoo.fr> wrote in message
news:bh**********@muguet.sncf.fr...
In fact, i know the fullpath (c:\liste1.txt) on client pc.
But in javascript, i can't using a datagrid.
SO......(I must use datagrid so using vb.net but file is on client pc)
javascript :
v_chemin = ParamValeur(maVariable);
var fs = new ActiveXObject("Scripting.FileSystemObject");
mon_fichier = fs.GetFile(v_chemin).OpenAsTextStream(1);
ligne = mon_fichier.ReadLine();
//REMPLIT DATAGRID
while (mon_fichier.AtEndOfStream==false){
ligne = mon_fichier.ReadLine();
//REMPLIT DATAGRID
}
//BINDLIST
"James J. Foster" <ja***@dotnetcoders.com> a écrit dans le message de news: uK**************@TK2MSFTNGP10.phx.gbl...
From ASP.NET, no, you cannot access the files on the client machine since
that code runs on the server. There would be severe security implications, not to mention technological hurdles, if you could ask the client
browser to
give you any file from the client's machine.

--
James J. Foster, DotNetCoders
http://www.dotnetcoders.com
"cedced" <ce********@yahoo.fr> wrote in message
news:bh**********@muguet.sncf.fr...
Hello,
is it possible to access client files in VB.NET?
What?
I have doing that but it isn't good (VB.NET take file on pc server and

not on pc client):
(thanks)
Dim fichier As StreamReader

Dim name As String

fichier = File.OpenText("C:\liste.txt")

name = fichier.ReadLine()

Response.Write(name)

Do While Not name Is Nothing

name = fichier.ReadLine()

Response.Write(name)

Loop

fichier.Close()



Nov 17 '05 #2
It is possible to access the file system on the client from any web page,
regardless of what is running behind it on the server. However, it can't be
done from the server. There is no connection between the server and the
client. The client sends a message to the server requesting a resource
(usually a file, such as an ASPX page). The server receives the message
(Request), processes it, and sends a message (Response) back to the client,
usually in the form of an HTML document. How then, can the server access
ANYTHING on the client?

How it is possible for any web page in the client browser to access the file
system on the client is by means of a Java Applet or ActiveX control in the
browser (embedded in an HTML document).

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Complex things are made up of
lots of simple things.

"cedced" <ce********@yahoo.fr> wrote in message
news:bh**********@muguet.sncf.fr...
Hello,
is it possible to access client files in VB.NET?
What?
I have doing that but it isn't good (VB.NET take file on pc server and not
on pc client):
(thanks)
Dim fichier As StreamReader

Dim name As String

fichier = File.OpenText("C:\liste.txt")

name = fichier.ReadLine()

Response.Write(name)

Do While Not name Is Nothing

name = fichier.ReadLine()

Response.Write(name)

Loop

fichier.Close()

Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Sean | last post: by
3 posts views Thread by Buddy Ackerman | last post: by
5 posts views Thread by Stanav | last post: by
9 posts views Thread by Bob Achgill | last post: by
18 posts views Thread by UJ | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.