Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


writting text.

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
OSIRIS
Grandmaster Cheater
Reputation: 0

Joined: 27 Aug 2006
Posts: 654

PostPosted: Tue Mar 11, 2008 8:22 am    Post subject: writting text. Reply with quote

Code:
Dim FILE_NAME As String = "C:\test5.txt"


        Dim objWriter As New System.IO.StreamWriter(FILE_NAME, True)
        objWriter.Write("TEXT FOR FILE GOES HERE")
        objWriter.Close()
        MsgBox("Text written to file")


Thats the code im trying to use to write the text. But I always get an acess denied error.


Last edited by OSIRIS on Tue Mar 11, 2008 8:35 am; edited 1 time in total
Back to top
View user's profile Send private message
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Tue Mar 11, 2008 8:24 am    Post subject: Reply with quote

make sure the file isn't in use or a system file.
Back to top
View user's profile Send private message
OSIRIS
Grandmaster Cheater
Reputation: 0

Joined: 27 Aug 2006
Posts: 654

PostPosted: Tue Mar 11, 2008 8:27 am    Post subject: Reply with quote

I give the user a choice of where to save the file his option is stored in a variable called location. And Im trying to create the file so it couldnt be in use already
Back to top
View user's profile Send private message
Haxory'
Grandmaster Cheater Supreme
Reputation: 92

Joined: 30 Jul 2007
Posts: 1900

PostPosted: Tue Mar 11, 2008 8:30 am    Post subject: Reply with quote

lemme see

(i probably can't solve but i will try)

_________________
you and me baby ain't nothing but mammals so lets do it like they do on the discovery channel
Back to top
View user's profile Send private message
OSIRIS
Grandmaster Cheater
Reputation: 0

Joined: 27 Aug 2006
Posts: 654

PostPosted: Tue Mar 11, 2008 8:35 am    Post subject: Reply with quote

Code:
Dim FILE_NAME As String = "C:\test5.txt"


        Dim objWriter As New System.IO.StreamWriter(FILE_NAME, True)
        objWriter.Write("TEXT FOR FILE GOES HERE")
        objWriter.Close()
        MsgBox("Text written to file")


Play around with this code. This one is just without all the variables
Back to top
View user's profile Send private message
Haxory'
Grandmaster Cheater Supreme
Reputation: 92

Joined: 30 Jul 2007
Posts: 1900

PostPosted: Tue Mar 11, 2008 8:37 am    Post subject: Reply with quote

Code:
Dim objWriter As New System(IO.StreamWriter(location))

try

_________________
you and me baby ain't nothing but mammals so lets do it like they do on the discovery channel
Back to top
View user's profile Send private message
OSIRIS
Grandmaster Cheater
Reputation: 0

Joined: 27 Aug 2006
Posts: 654

PostPosted: Tue Mar 11, 2008 8:39 am    Post subject: Reply with quote

haxory' wrote:
Code:
Dim objWriter As New System(IO.StreamWriter(location))

try


I get the blue line Sad

Back to top
View user's profile Send private message
Haxory'
Grandmaster Cheater Supreme
Reputation: 92

Joined: 30 Jul 2007
Posts: 1900

PostPosted: Tue Mar 11, 2008 8:44 am    Post subject: Reply with quote

hmm sorry i dont know it then
_________________
you and me baby ain't nothing but mammals so lets do it like they do on the discovery channel
Back to top
View user's profile Send private message
OSIRIS
Grandmaster Cheater
Reputation: 0

Joined: 27 Aug 2006
Posts: 654

PostPosted: Tue Mar 11, 2008 8:46 am    Post subject: Reply with quote

haxory' wrote:
hmm sorry i dont know it then


I just tried modifing the directory so My Documents and it worked Very Happy I guess you just can't put txt files in the c drive. See my new code it worked.


Code:

Dim FILE_NAME As String = "C:\Users\Stefon\Documents\test9.txt"


        Dim objWriter As New System.IO.StreamWriter(FILE_NAME, True)
        objWriter.Write("HI")
        objWriter.Close()
        MsgBox("Text written to file")
Back to top
View user's profile Send private message
Haxory'
Grandmaster Cheater Supreme
Reputation: 92

Joined: 30 Jul 2007
Posts: 1900

PostPosted: Tue Mar 11, 2008 8:53 am    Post subject: Reply with quote

ok nice.

have fun with it

_________________
you and me baby ain't nothing but mammals so lets do it like they do on the discovery channel
Back to top
View user's profile Send private message
OSIRIS
Grandmaster Cheater
Reputation: 0

Joined: 27 Aug 2006
Posts: 654

PostPosted: Tue Mar 11, 2008 8:59 am    Post subject: Reply with quote

haxory' wrote:
ok nice.

have fun with it


now I have to rewrite my whole program Sad
Back to top
View user's profile Send private message
Haxory'
Grandmaster Cheater Supreme
Reputation: 92

Joined: 30 Jul 2007
Posts: 1900

PostPosted: Tue Mar 11, 2008 9:28 am    Post subject: Reply with quote

i wish you success
_________________
you and me baby ain't nothing but mammals so lets do it like they do on the discovery channel
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites