Quantcast

Jump to content

Welcome to GameOn365
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. If you already have an account, login here - otherwise create an account for free today!
Photo

[VB] Saving TextFiles

* * * * * 1 votes

  • Please log in to reply
12 replies to this topic

#1
brarei200

brarei200

    Member

  • Members
  • 22 posts
  • :
Here's a quick little Function I made to save text to text files!


Import Statements
Import System.IO

Function
Private Function SaveTextToFile(ByVal strContent As String, ByVal strFileName As String) As String
   Dim swWriter As New StreamWriter(strFileName)
   swWriter.Write(strContent)
   swWriter.Close()
   Return (strContent)
End Function

Usage
SaveTextToFile("Hello", "Test.txt")

Edited by brarei200, 15 January 2011 - 10:42 AM.


#2
AOE

AOE

    Member

  • Members
  • 46 posts
  • Time Online: 49m 53s

Here's a quick little Function I made to save text to text files!


Import Statements

Import System.IO

Function
Private Function SaveTextToFile(ByVal strContent As String, ByVal strFileName As String) As String
   Dim swWriter As New StreamWriter(strFileName)
   swWriter.Write(strContent)
   swWriter.Close()
   Return (strContent)
End Function

Usage
SaveTextToFile("Hello", "Test.txt")


Awesome I was looking for this, thanks man

#3
brarei200

brarei200

    Member

  • Members
  • 22 posts
  • :
Yup, no problem, I might post my other function to Read Text Files in Visual Basic sooner or later :D

#4
AOE

AOE

    Member

  • Members
  • 46 posts
  • Time Online: 49m 53s

Yup, no problem, I might post my other function to Read Text Files in Visual Basic sooner or later :D


That will be awesome since I am wanting to know that also haha.

#5
brarei200

brarei200

    Member

  • Members
  • 22 posts
  • :
Okay, I'll go post it.

#6
AOE

AOE

    Member

  • Members
  • 46 posts
  • Time Online: 49m 53s

Okay, I'll go post it.


Sweet, Thanks. Feel free to post anymore that you have or know haha :pinch:

#7
brarei200

brarei200

    Member

  • Members
  • 22 posts
  • :

Sweet, Thanks. Feel free to post anymore that you have or know haha :pinch:


What do you want a tutorial on? I know tons about Visual Basic ;)

#8
AOE

AOE

    Member

  • Members
  • 46 posts
  • Time Online: 49m 53s

What do you want a tutorial on? I know tons about Visual Basic ;)


I would say just anything that would help out a new coder like my self, I know the basics and I can make simple bots but I know one thing I am working on I just cant get it and it has captchas in it =/ Like I have the code to load it but its a diff captcha then the one on the webpage

#9
brarei200

brarei200

    Member

  • Members
  • 22 posts
  • :

I would say just anything that would help out a new coder like my self, I know the basics and I can make simple bots but I know one thing I am working on I just cant get it and it has captchas in it =/ Like I have the code to load it but its a diff captcha then the one on the webpage


This should do the trick ;)

For Each Captcha As HtmlElement In WebBrowser1.Document.All
Dim Link = Captcha.GetAttribute("src")
If Captcha.GetAttribute("src").Contains("part of source that never changes") Then
frmCaptcha.picCaptcha.ImageLocation = Link
frmCaptcha.Show()
End If
Next


#10
AOE

AOE

    Member

  • Members
  • 46 posts
  • Time Online: 49m 53s

This should do the trick ;)

For Each Captcha As HtmlElement In WebBrowser1.Document.All
Dim Link = Captcha.GetAttribute("src")
If Captcha.GetAttribute("src").Contains("part of source that never changes") Then
frmCaptcha.picCaptcha.ImageLocation = Link
frmCaptcha.Show()
End If
Next


So this is gunna make it go into my picture box I have? lol sorry kinda confused a lil haha I am a noob also heh

I am needing help with a bot wanna help? for predicto? a legit site

Edited by AOE, 17 January 2011 - 12:34 AM.


#11
brarei200

brarei200

    Member

  • Members
  • 22 posts
  • :
I already made a bot for Predicto, wanna buy it off me? :)

#12
AOE

AOE

    Member

  • Members
  • 46 posts
  • Time Online: 49m 53s

I already made a bot for Predicto, wanna buy it off me? :)


no thanks haha, there is a few i have already but i wanna make my own

#13
Zawazuki

Zawazuki

    Member

  • Members
  • 24 posts
  • Time Online: 1h 25m 23s
Nice little tutorial. This may help me soon enough when I start coding again. Thank you for this tutorial! :)

Edited by Zawazuki, 18 March 2011 - 07:06 PM.

Posted Image





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users