gsb Posted March 1, 2007 Share Posted March 1, 2007 (edited) First, Thanks all for the help so far. You all are a great help. Now I need a push in the right direction. In my control, I can open and copy to the clipboard some small text from my .ini file. Now I have a need to copy a big 50-60 lines from a file to the user's clipboard. I was hoping I could keep the file on my server and ... what? That is my question. How would I go about reading the file contents from the server "behind the scenes" so to speak. Hope you all have some clever ideas that you can share with me on this one. For I do not know a good approach. gsb Edited March 1, 2007 by gsb "Did you ever stop to think? ...and forget to restart!" Link to comment Share on other sites More sharing options...
herewasplato Posted March 1, 2007 Share Posted March 1, 2007 (edited) If the 50 to 60 lines is the entire file then: ClipPut(FileRead(...)) If the 50 to 60 lines is only part of the file of interest then look at FileReadLine. Edit: As long as the user has "read permissions" on the server/file of interest, FileRead should be able to read it for them. I would suggest using a UNC path to the file instead of mapping a drive. Edit: typos Edited March 1, 2007 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
gsb Posted March 1, 2007 Author Share Posted March 1, 2007 Hi and thanks herewasplato, But the FileOpen/FileRead seems to be foe a local file, not a remote (server) file/URL. See I am trying to read a text file that will be on the server not local to me. Any thoughts there, or am I missing something? gsb "Did you ever stop to think? ...and forget to restart!" Link to comment Share on other sites More sharing options...
WeMartiansAreFriendly Posted March 1, 2007 Share Posted March 1, 2007 try InetGet or _inetgetsource Don't bother, It's inside your monitor!------GUISetOnEvent should behave more like HotKeySet() Link to comment Share on other sites More sharing options...
herewasplato Posted March 1, 2007 Share Posted March 1, 2007 FileOpen and FileRead will work with "UNC" or "mapped drive" paths. If the file is on a file server, then test my suggestion with this one line of code from within the SciTE editor: ConsoleWrite(FileRead("......")) If the file is on a "web" server that your users won't have file level access to - then there are several ways to get the file - mrRevoked has given you a couple. ...enjoy... [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
nerdgerl Posted March 1, 2007 Share Posted March 1, 2007 (edited) Here's what I came up for a similar situation: ;Open browser $RFOI=ObjCreate("InternetExplorer.Application.1") ;Keep the browser hidden from user $RFOI.Visible=0 ;Visit website $RFOI.Navigate("http://www.awebsite.com/a.php") ;Read webpage into variable $RFOIcontent = _IEDocReadHTML($RFOI) ;Put webpage content onto clipboard ClipPut($RFOIcontent ) ;Close browser _IEQuit ($RFOI) Edited March 1, 2007 by nerdgerl My AutoIT's:[topic="53958"]Personal Encyclopedia/Dictionary[/topic][topic="46311"]MS Access (Style) Database[/topic]"Some people are born on third base and go through life thinking they hit a triple." Link to comment Share on other sites More sharing options...
gsb Posted March 1, 2007 Author Share Posted March 1, 2007 (edited) Yes herewasplato. I did mean a web server, sorry to be so unclear at that. mrRevoked, May well be the push I needed, Thank You. And nerdgerl. Thank you too. A full script. I will try it. I will try all these later this morning. Again, Thank you all for your help. gsb Edited March 1, 2007 by gsb "Did you ever stop to think? ...and forget to restart!" Link to comment Share on other sites More sharing options...
gsb Posted March 1, 2007 Author Share Posted March 1, 2007 OK! So here is what I found to work fine: #include <INet.au3> ClipPut( _INetGetSource( 'www/..../tutorial_post.txt' ) ) Thanks again all. gsb "Did you ever stop to think? ...and forget to restart!" Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now