.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old June 4th, 2003, 11:34 PM
Marko Marko is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 2 Marko User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
write textbox content to clientside TXT file

Pleas help me ! <br>how can I write the content of a textbox to the TXT file in client side ?<br>(I'm working about 4 days ago with this problem)<br>Thank You !

Reply With Quote
  #2  
Old June 5th, 2003, 06:27 PM
dcarva's Avatar
dcarva dcarva is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Jan 2003
Location: USA
Posts: 633 dcarva User rank is Lance Corporal (50 - 100 Reputation Level)dcarva User rank is Lance Corporal (50 - 100 Reputation Level)dcarva User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 9 h 18 m 20 sec
Reputation Power: 6
Hello,<br><br>I am pretty sure that you can't do this for security reasons. Browsers don't allow you to modify files on a client system. If that was possible, it would make it very easy for a hacker to modify files on the system of the person viewing the web page. I have done this sort of thing with an ActiveX control. This is possible because ActiveX controls are installed on the client system.<br><br>Anyone, if I am wrong about this, please let me know.<br><br>Danny<br> <img border="0" src="/forum/emoticons/wink.gif" height="15" width="15" alt=";-)" /><!-- Edit --><p><i>Last Edited : 6/5/2003 3:28:29 PM GMT</i></p>

Reply With Quote
  #3  
Old June 5th, 2003, 09:13 PM
Stallion112 Stallion112 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 29 Stallion112 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I believe what dcarva said is true, however you can work around this<br>by writing the file server side. Here is what I mean:<br><br>One of my past programs, I allowed the client to fetch data and view it.<br>Then they would press a button that says "Excel" on it. When they press<br>the button, in my code behind, I would create a new html page as a stringbuilder, <br>then create a new file, and write the HTML to the new file.<br><br>Here is a simplified version of my code to help:<br>NOTE: REMOVE THE DECIMALS YOU SEE IN THE OPENING TAGS. <br>i.e. <.HTML>, <.HEAD>, <.FONT>, <.TABLE>, etc.<br><br>(The code will not post on this messageboard with the actual tags)<br><br><div class="msgQuoteWrap"><div class="msgCode"><br>Imports System.IO<br>Imports System.Text<br><br>Public Class WriteFile<br><br> Private Sub btnExcel_Click(ByVal sender.., ByVal e ..) Handles..<br> <br> 'Put Displayed Data into an Excel Spreadsheet<br><br> Dim oSB As New StringBuilder()<br><br> oSB.Append("<.HTML>")<br> oSB.Append("<.HEAD>")<br> oSB.Append("</head>")<br> oSB.Append("<.body>")<br> oSB.Append("<.form id=mainform method=post>")<br> oSB.Append("<.table class=Mtable id=MsgTable cellSpacing=0 cellPadding=0 width=95% align=center>")<br> oSB.Append("<.tr>")<br> oSB.Append("<.th bgColor=#336699 Align=center><.font color=#ffffff>Column 1</font></th>")<br> oSB.Append("<.th bgColor=#336699 Align=left><.font color=#ffffff>Column 2</font></th>")<br> oSB.Append("<.th bgColor=#336699 Align=right><.font color=#ffffff>Column 3</font></th>")<br> oSB.Append("<.th bgColor=#336699 Align=right><.font color=#ffffff>Column 4</font></th>")<br> oSB.Append("<.th bgColor=#336699 Align=right><.font color=#ffffff>Column 5</font></th>")<br> oSB.Append("</tr>")<br> oSB.Append("</table>")<br> oSB.Append("</form>")<br> oSB.Append("</body>")<br> oSB.Append("</html>")<br><br> Dim sXLSFile As String<br> Randomize() ' Initialize random-number generator.<br> sXLSFile = CInt(Int((1000 * Rnd()) + 0)) ' Generate a random value between 0 and 1000.<br><br> 'Create the New Excel File<br> Dim oFile As New StreamWriter("C:InetpubwwwrootExcelFile" & sXLSFile & ".xls")<br><br> oFile.Write(oSB.ToString)<br> oFile.Close()<br><br> 'Direct the User to View the Excel File<br> Response.Redirect("C:InetpubwwwrootExcelFile" & sXLSFile & ".xls")<br> End Sub<br><br>End Class<br></div></div><br><br>The only downside to this, is that the files will be stored on the server, but you can clean up the contents of the folder every so often. Since you will be writing text files, they will not be so big, so I wouldn't even worry about that. If you have any questions, just post it here.<br>Good Luck!

Reply With Quote
  #4  
Old June 6th, 2003, 01:43 AM
Marko Marko is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 2 Marko User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thank You Everybody !<br>I think you told me the truth. I try a lot of code, but nothing is working...<br>My problem is : select some record (in the browser with 'online' parameters) from a database and I transfer it to XML format (It is working, but...), and I Like to transfer the XML file to client side, because client's application does not support XML. (I have a simple program which is translate the XML file to client's database - of corse offline)<br><br>I will thankful for any idea to anybody !<br>marko

Reply With Quote
Reply

Viewing: ASP Free ForumsProgramming.NET Development > write textbox content to clientside TXT file


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT