Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.1
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 26th, 2004, 10:32 PM
Registered User
 
Join Date: Jan 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to read the client's text file?

Dear all,
I am trying to connect the MS SQL Server Database.
When user browses my website.
He can create a text file on his local disk.
And the text file has some Product_ID.
Could the server's ASP.NET program can read that text file and select the Product where Product_ID = the text file's Product_ID??
The point is " How can I read the text file in client's disk ? "
Or is any configuration has to be set ??
Thanks a lot !

 
Old January 26th, 2004, 11:28 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

You can't do that. The server has no ability to read anything on the client's machine. The only thing you could do is provide the ability for the user/client to upload the text file.

Peter
------------------------------------------------------
Work smarter, not harder.
 
Old January 27th, 2004, 01:15 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

I dont think so, there must be a way Im sure look for it! im sure u'll find some samples. use some sites & ur .NET Documentation.

Always:),
Hovik Melkomian.
 
Old January 27th, 2004, 09:26 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

ASP.NET can't. But there is a way. You have to use 'Smart Clients'. You also have to set the permission of the Smart Client to read so that it can gather the necessary information. Smart Clients are VB applications and they run in a sandbox on the user's machine. The user also has to have the .Net framework installed. And you have to have a Web Service enabled to receive data sent to the web server.

 
Old February 12th, 2004, 01:19 PM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 336
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alyeng2000
Default

i think you could use the method of File Control to upload the client file to the server , i use this function to upload images to sever

    Function loadPicToServer(ByRef ofile As System.Web.UI.HtmlControls.HtmlInputFile, ByVal ServerVirtualDir As String) As String
        Dim strFileName As String
        Dim strFilePath As String
        Dim strFolder As String

        strFolder = HttpContext.Current.Server.MapPath(ServerVirtualDi r & "\")

        'Get the name of the file that is posted.
        strFileName = ofile.PostedFile.FileName
        strFileName = Path.GetFileName(strFileName)
        If strFileName = "" Then Return ""

        'Create the directory if it does not exist.
        If (Not Directory.Exists(strFolder)) Then
            Directory.CreateDirectory(strFolder)
        End If

        'Save the uploaded file to the server.
        strFilePath = strFolder & strFileName

            ofile.PostedFile.SaveAs(strFilePath)
            Return strFileName & " has been successfully uploaded."

        'Display the result of the upload.
        '''frmConfirmation.Visible = True
    End Function

if any one find a smartest solution or modification i would be appreciated for that.

Ahmed Ali
Software Developer





Similar Threads
Thread Thread Starter Forum Replies Last Post
read text file senthilreddy ASP.NET 1.0 and 1.1 Basics 1 December 19th, 2010 10:56 PM
Read and Edit the text file stuartlittle C# 3 February 26th, 2008 05:35 AM
Read Text file and convert to Binary file VB.net sjlsysprg1 Pro VB.NET 2002/2003 4 June 29th, 2007 06:53 AM
How to read a line from a text file ? nobitavn94 C# 3 November 25th, 2006 11:04 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.