Registry (Save And Read) And Get The # Of Lines In A String!
Since I don't know how to properly use API, can someone please write me a code that has 2 functions (1 for writing strings into the registry and the other for reading from the registry!). Thanks for your help.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Need Help Converting Write/read Text File To Save/get From The Registry.
For my testing purposes, I kept things simple and used basic text files. Now that I'm about to release a Beta test, I need to convert all of it to save/get setting from the registry. Here's the code I have:
Code:
Option Explicit
Public LoginSucceeded As Boolean
Private Sub cmdCancel_Click()
frmAgree.Show
frmLogin.Hide
End Sub
Private Sub cmdOK_Click()
Dim strUN As String
Dim strPW As String
Dim bfound As Boolean
If txtPassword.Text & txtUserName.Text = "" Then
MsgBox ("Please enter your username and password before pressing accept")
Exit Sub
End If
Open "C:EZ-AccessDatapasswords.txt" For Input As #1
Do While Not EOF(1)
Input #1, strUN, strPW
If strUN = UCase(txtUserName.Text) And UCase(txtPassword.Text) = strPW Then
strUser = strUN
bfound = True
Exit Do
Else: bfound = False
End If
Loop
Close #1
If bfound = True Then
frmStart.Show
Unload Me
End If
If bfound = False Then
MsgBox ("Try Again")
End If
End Sub
Private Sub Form_Load()
End Sub
Notice how I open a text file, read it, and then loop it. Well, I have no idea where to even start with the registry save/get. Of course, it will have to be getsetting, and it will come from this other form:
Code:
Private Sub cmdChk_Click()
Open "C:EZ-AccessDatausers.txt" For Input As #1
Do While Not EOF(1)
Input #1, strUse
If strUse = UCase(txtUser.Text) Then
Close #1
digAgree.Show
Close #1
Exit Sub
Close #1
Exit Do
Close #1
End If
Loop
Close #1
digUser.Show
End Sub
Private Sub cmdSubmit_Click()
Dim Username As String
Dim password As String
Dim password2 As String
Dim fname As String
Dim lname As String
Dim email As String
Username = frmAgree.txtUser.Text
password = frmAgree.txtPass.Text
password2 = frmAgree.txtPass2.Text
fname = frmAgree.txtFname.Text
lname = frmAgree.txtLname.Text
email = frmAgree.txtEmail.Text
If strUse = UCase(txtUser.Text) Then
digAgree.Show
Else
If txtUser.Text = "" Then
MsgBox ("Please choose an username.")
Else
If txtPass.Text = "" And txtPass2.Text = "" Then
MsgBox ("No password entered. Please complete the fields")
frmAgree.Show
Else
If UCase(txtPass.Text) = UCase(txtPass2.Text) Then
Open ("C:EZ-AccessDatapasswords.txt") For Append As #1
Write #1, UCase(Username); UCase(password)
Close #1
Open ("C:EZ-AccessDatausers.txt") For Append As #1
Write #1, UCase(Username)
Close #1
If fname & lname & email = "" Then
frmLogin.Show
Unload frmAgree
strAgree = True
Else
Open ("C:EZ-AccessDataoi.txt") For Append As #1
Write #1, UCase(fname); UCase(lname); UCase(email)
Close #1
End If
Open "C:EZ-AccessDatalaunch.txt" For Output As #1
Write #1, "NO"
Close #1
MsgBox ("Thank you for using EZ-Access Quick Launch")
frmLogin.Show
Unload frmAgree
strAgree = True
Else: MsgBox ("Your passwords do not match. Please reverify.")
If Trim$(txtUser.Text) = "" Then MsgBox ("Blank spaces are not allowed. Nice Try")
End If
End If
End If
End If
End Sub
Private Sub cmExit2_Click()
End
End Sub
Private Sub Form_Load()
Dim strUse As String
End Sub
Again, I know that this will be the form for savesetting, but I have no clue where to go with it. Do I need to take out the looping of it, how will it store multiple usernames (My testing of savesetting always overwrote what was already there instead of creating a new), what do I need to do. I'm confused. I do know how to use the save/get setting now, but not in this situation. As always, any and all help is appreciated.
Thanks!
Read Multi-string Registry Value
hi people.
im stuck on reading a multi-string registry value. If you have any shared folder on your computer you can see the problem im getting here:
HKEY_LOCAL_MACHINESYSTEMControlSet001ServiceslanmanserverShares
Im trying to read the key "wireless" and the value is:
CSCFlags=0
MaxUses=4294967295
Path=C:Documents and SettingsmeDesktopNew Folder
Permissions=0
Remark=
Type=0
but via reading it normally i only get "CSCFlags=0" but how can i get all that data not just the first line?
thanks
Read And Writing New Line To Multiline Registry String
I've been a bit confused with some of the registry examples I've seen so far...
Theres a registry string that may or may not exist. If it doesn't I want to add it. I need to check this string and if it does exist I need to write a new line without overwriting the previous data.
How can I achieve this?
Sorry if the question is vague.
Thanks
Hmm - New Lines Arent Read As New Lines By Vb In A File
Heres the situation
im using urldownloadtofile to download a text file from the internet onto the harddrive. although the textfile on the net has 5 items, each on a single line, when i use that function the file saves as 5 items all on a single line.. and where a new line is supposed to be, i see a "box" in notepad..
needless to say, when i try to load the file into an array using Line Input, all 5 items are on a single array number, instead of one item in each array number..
heres what i mean..
text file online:
a
b
c
d
e
text file when downloaded to hd:
a[]b[]c[]d[]e
the box is interesting, if i copy the entire text from the file on my hd and paste it, they paste with all 5 items on seperate lines..
my question is, how can i load a[]b[]c[]d[]e with one item in each array with VB? line input wont work cause itll store a[]b[]c[]d[]e in one string
Read Lines And Count Lines From Txt File - Thank Ye All
hello again
im back for some more help, so i hope you guys can.
ive had a quick search on the forums for this but cant find anything that helps, so heres my problem:
i have this code:
Code:
Function random2()
Dim lines As Integer
Dim current As String
lines = 0
Open "C:files.txt" For Append As #1
Do While Not EOF(1)
Line Input #1, current
lines = lines + 1
MsgBox (current)
Loop
Close #1
txtFILE = lines
End Function
but that code doesnt work, it does count the lines at all, i get no msgbox's, no count, no nothing.
any help would be much appreciated.
thanks.
Primary_Slave
----------------------------------------------------------------------------------------
I'm all wrapped up in my binary blanket and I'm coding on late into the night
----------------------------------------------------------------------------------------
Edited by - Primary_Slave on 11/4/2004 9:46:42 AM
Read String From File And Save It To Another File With Change
Private Sub Command1_Click()
Dim FileNum As Long
Dim line1, line2, line3, strfind As String
Dim i As Integer
strfind = "pagebreak"
I am trying to read a string and look for the word "pagebreak" and write the string to a new file repacing the pagebreak with vb newline. I need my new text file to have new pages every time I read the pagebreak string. The following code work, but copy the code to a new file without starting a new page.
Thanks
strfind = "pagebreak"
FileNum = FreeFile
Open "c: est.dat" For Input As #FileNum
Do Until EOF(FileNum)
Input #FileNum, line2
line1 = line1 + line2
i = i + 1
line3 = ReplaceFirstInstance(line1, strfind, NewPage)
Loop
End Sub
Function ReplaceFirstInstance(textbody, searchfor, startover)
FoundLoc = InStr(1, textbody, searchfor)
If FoundLoc <> 0 Then
Open "C: est2.txt" For Output As #2
Print #2, textbody & NewPage
Close #2
Else
ReplaceFirstInstance = SourceString
End If
End Function
Save To Registry Or Save To .txt Or .ini File?
Perhaps I should have posted this as a poll, but hey-ho...
Right, following on from a few points made (see thread http://www.codeguru.com/forum/showt...threadid=236942 if you are wondering where these points were made) I was wondering whether it is better to save settings such as window positions and size, and other settings specific to your application to the registry, or in a .txt or .ini file.
Personally, I have always saved all window positions and size settings (and sometimes a few other things) to the registry, and then for applications where I need a lot of settings saved I have used .txt files (provided no database is involved).
Where do you draw the line in saving information to the registry and start saving to another file? Or, do you do just one and not the other? And, are there any speed advantages in either, or is it much the same?
Thanks for any input.
What's Best Way To Do Read These Lines?
Each day I am going to first create a text file manually like this:
apples 100
oranges 50
peaches 70
...
There will be about 20 lines. I want to read the items into a string variable and the numbers into a long variable. Each variable will be passed to its own procedure.
What is the best way to do this? Just use regular sequential I/O or do I need random access file? Or should I read each line into an array first and then split them? I don't care if I have to use commas or tabs instead of spaces. For example, it's fine if I have to make the text file look like this:
apples, 100
...
or
apples [tab] 100
...
Thanks.
Read Lines
what i am trying to do is open a file, and on each line will be some text, and for the text on each line, it will go on a row in a ListView. the thing is, i dont know how to find each line in a file or anything like that. I have found no information on this and am hoping someone knows how to do this, thanks
Save In Lines...
hi. Im making a Rpg game with a wierd coding.
My Main Page is made out of 29 x 15 images. Each of them recieves a value that i load from a text file that is also saved in a 29 x 15 format. Depending on the value, the image will have specific picture.
but once i change one of those values, i dont know how i can save the values back in the text box in lines like it did before.
heres what the text box looks like.
11111111111111111111111111111
10c777777777ddddddd7777d00001
100000000000c77ddd5fggh900001
100000000000000cdd5ijjk900001
10000000000000009d5lmmn900001
10000000000000009ddb00ad00001
10000000000000009dd5009000001
10000000000000000005009000001
10000000000000000000000000001
1000000000z000000000000000001
10000000000000000000000000001
10000000000000000000000000001
10000000000000000000000000001
10000000000000000000000000001
11111111111111111111000011111
here is my code that loads these values in the images.
Dim ligne As Byte, colonne As Byte
Dim planche(nblignes, nbcolonnes) As String
Dim l As Byte, c As Byte
Const nbcolonnes = 29
Const nblignes = 15
Dim texte As String
Open App.Path & "Map2.txt" For Input As #1
For l = 1 To nblignes
Line Input #1, texte
For c = 1 To nbcolonnes
planche(l, c) = Mid(texte, c, 1)
Next c
Next l
Close #1
all i need is some coding that will let save changes i make to these values back in line format so i can load them again and again. Do you think you could help me???
Can I Read Specified Lines In A Txt File??
Hi, i am a very new newbie.
I have a log file like this format:
0
...........(data in the log file, only one line)
0
...........(data in the log file, only one line)
0
...........
...........(data in the log file, two lines)
0
.........
.........
0
..........
0
I want read the data lines enclosed by the "0"s one by one and return it into string.
Any good idea?
Thanks....
Sami
Read Txt File Lines!!!
HI!!
Can anyone please tell me how can i read a specific line in textfile??
like i have 3 lines in text file:
this s first line
second line!
and the third!
How can i read second line???
Thanx!!
Read Lines From Textfile
I'll give ya a senario...
on my form, i have:
~10 command buttons
~1 text box
~1 Textfile,,, if this needs to be a .txt or .ANYTHING ill change in a sec (app.path + "settings.ini")
what i want it to do is when i push Command# i want it to display THAT # life of text into the textbox... so for example
if I push Command1 then
take line one from (app.path + "settings.ini")
and display it in Text1.text
if i push button 2, then i want it to display line 2,,, and so fourth, ive been stuck on this for a few days.. looked at multiple good websites, downloaded tutorials, tried to get help from online chats... no luck
please help me, im not really sure where to start, so im totally in the dark
How Do I Read Lines In A Textbox
How do i read lines in a textbox,
I use the open and open a file into the textbox
Text1, when i use :
Text1.Selstart = 0
Text1.SelLength = 200 it copies the whole line plus next line
line number 2, how can i just read the line i need
say i need line 20 this time i need to read the line, i would need the code that can do this job incase i am anotehr window, i had to leave the Text1.SetFocus out, also i had
to leave the SendKeys "{+END}", True because i maybe
in another window to avoid jumping to my program to get a line in a textbox Which is text1 how can i read any line in text1 text1 has 200 lines so i hope you can help me out with
a code that can get the line of text i need to get Line number
55 in a textbox how i go's about doing that.
Thank You Have nice Sunday Evening all
Bye
How To Read Certain Lines In A File And Tell What Is Different
Hello,
I have 2 files that I am going to compare. I was wondering how would I go about to read those files, and tell what is different. Take for instance...that file1.txt has <name>Fred</Fred>
<name>Barney</name>
<name>This</name>
File2.txt has...
<name> Barn</name>
<name> Fred</name>
<name> This</name>
Then I would have file box say file2.txt is different than file1.txt.
Because it has more names than than file1.txt and also file2.txt is missing barney.
Can someone tell me of a website that can help me with this, or can they help me themselves?
Read/Write 2 Lines
Hello all, i'd like to know howto read one line (define it to a variable), and then do the next with the string on the next line. thanks guys ^^
Read More Lines From Textfil
I'm making a program, were i can store my results from school. The results i put into a textfile called: variable.txt.
Now the program have tot read te textfile, and store each line in an variable.
So each line have is own variable.
But now the problem, i created this code for reading and store the variable:
VB Code:
strFile = "C:Documents and SettingsNilsBureaubladcijfersvariable.txt" 'your file with full path file must exist before you read from it Open strFile For Input As 1 'open text file for reading Line Input #1, strTemp 'read first string to variable Close #1 ec1.Text = strTemp
As you see it opens the file variable.txt, read it and puts the data on line 1 into the variable strTemp. After that the variable is shown in an textbox called ec1.
This works fine, but i have more results, and another result is on the second line in variable.txt. I wanna do the same thing with the secondline as with the first line. Someone knows how i should do this?
Read Multiple Lines
Hi,
If I have a textfile with, for an example, 3 different lines, how can I read that lines and put them in 3 different textboxes per line.
thnx
VB.Net Read Multiple Lines In Txt
Hey Guys,
Does anyone have a code on how to read a txt file with multiple lines?
Example of text file
this is my first line
this is the second line
this is the third line
this is the forth line
here is my code but it only displays the last line.
Code:
Imports System
Imports System.IO
Public Class Form1
Private Const FILE_NAME As String = "C: est ext.txt"
Public Sub Main()
If Not File.Exists(FILE_NAME) Then
TextBox1.text = "{0} does not exist." & FILE_NAME
Return
End If
Dim sr As StreamReader = File.OpenText(FILE_NAME)
Dim input As String
input = sr.ReadLine()
While Not input Is Nothing
TextBox1.Text = input
input = sr.ReadLine()
End While
sr.Close()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Main()
End Sub
End Class
Read Certain Lines From Txt File
I am reading a txt file for a puzzle game. I use the first line for the Category. The rest of the lines are the answers. I can read line 1 fine to get the Category. I can also read All the Lines for the answers. I need to know how to only read from Line 2 to the EOF for the answers.
Thanks in advance,
Phil
Read From File And Store Lines
Hi there,
This is the code I have so far:
I wish to open this text file and then store each line of the text file in a different variable. Each line consists of a file path.
This is my code so far
It would be really good if anyone could help. Thanks.
Code:
Public Sub actuallybindnow()
Dim thefilenames As String
Open App.Path & "indhelp.txt" For Input As #66
While Not EOF(66)
Input #66, thefilenames
Wend
Close #66
End Sub
How To Read Different Lines Of A Text File?
I'm sure this is an easy enough question to answer but I wasn't able to find any threads about it so my apolgies if it has already been answered.
Basically what I need to do is read different lines of a text file depending on a random number for example on a number of 4 it will read line 4 of the text file. I am aware how to read the first line of a text file with
Open ("C: est.txt") For Input As 1
Line Input #1, strTest
Text1.Text = strTest
Close #1
however I am unaware on how to read any other lines.
Any help is greatly apprecitated thanks in advance
Read First Ten Lines Of A Text File?
I have some code that currently reads the first line of a text file. I want to change this and have it read the first ten lines, is this possible?
Here is the current code (blatantly simple):
'Open File for Reading
Open workfile For Input As #1
'Read in first line of file
Line Input #1, strFilesText
Close #1
Thanks.
Read In LineS Of Text Into An Array
hey guys
i've looked at other posts but can only seem to get this to work for 1 line:
what i want to do.
i have a txt file with data as such
1
2
3
4
5
6
7
8
9
10
i need to read this into an array eg:
dim arrdata(1 to 10)
open **** for input as #1
lineinput #1, data
and from there i'm lost>.........
what is the code i need to:
read line 1, store to arrdata(1)
read line 2, store to arrdata(2)
read line 3, store to arrdata(3)
etc etc etc
is there a way i could do it with a loop
for i=1 to 10 step 1
read line i ???????? store to arrdata(i)
next i
any help appreciated [especially good help cheers
Save Picturebox (with Lines And Label) To Bmp
Hi,
My application has a requirement where I plot a hugh diagram on picturebox based on some data-analysis.
This diagram is drawn by creating Line, label and command button controls on runtime and placing them on picture box. The contents of picture box are not really picture as I really act on the events recvd from label and command buttons.
Now my problem is that when I try to save this image to bmp file I don't get all the contents correctly.
Effectively I'm not able to capture all the contents of PictureBox correctly. I'm using BitBlt to this.
So pls enlighten me on what is the best way to do this?
Thanks in advance
Mandeep
Save Text With Out Extra Lines
i have a code that saves some settings in my app like a picture path for the background
i use the rtf as i dont want to code a lot of code just to save a text doc. i got it to save a text doc but it saves with 1 or 2 lines with nothing on it and when i load my app. it does not work because of these lines.
can i get my app to save text on only one line no matter how long the path is?
Read First Ten Lines Of Text File?
I have some code that currently reads the first line of a text file. I want to change this and have it read the first ten lines, is this possible?
Here is the current code (blatantly simple):
'Open File for Reading
Open workfile For Input As #1
'Read in first line of file
Line Input #1, strFilesText
Close #1
Thanks.
Don't Save The Emty Lines, Or Not To Open Them?
I have a text file that I want to save from my program. But I don't want to
save the empty lines. I want to delete everything after the last character,
Is that possible?
Then when I read the text file i don't want to read empty lines(If the user
as edit the file in notpad..), sense it makes commas at all new lines and
then split the text at every comma in to an array.
The array will contain empty "slot's" if there is a lot of commas in a raw
(like it will be if there is many empty lines at the end/beginning of the
file)
This is the text file:
http://www.google.com,Google
http://www.dustin.se,Dustin
http://www.Microsoft.com,Microsoft
Yours, Jonas
Read Lines In Files... E.G Line 8 PLEASE Help Me
Hi,
Please could someone give me the code to make it so that my project open a file to read from and read a lien number of my choice...
The code would probaly be in a midule then i would insert the code into a command button
e.g:
Code:LineNum(8)
This will read from "C: est.txt" and on line 8
If u dont uderstand plz say so...If u do plz help
Thx
------------------------------------------------------------------------------
And when a man gets to heaven,
To saint Paul he'll tell:
1 more soldier reporting sir,
I served My Time in Hell
6 June 1944
2GB DDR400 RAM, 3.4Ghz EM64T P4 Socket 775, 200gb PATA HD 8mb cache, 500GB WD 16mb Cache (Master), 256mb 9950 ATI RADEON AGP ,19" LCD, and a 250W PSU
Running Vs6 Enterprise, running all vs8 products express edition
How To Read A Few Lines From A Text File
HI all - i'm realy stuck
I'm reading a .txt file into a textbox but i'm only interessted in a few lines.
eksample:
DCT4NCK by jozso v0.0a
----------------------
IMEI is '350774103958688'
ASIC Type is 2
Provider is '21601'
Box serial is '32820'
#pw+989202003754006+1#
#pw+253265375104161+2#
#pw+325166543323363+3#
#pw+404257220234456+4#
#pw+058323470625423+5#
#pw+429257443744651+6#
The Above shows whats in my text box.
Now i want to sort out my text so the only thing remaining is:
#pw+989202003754006+1#
#pw+253265375104161+2#
#pw+325166543323363+3#
#pw+404257220234456+4#
#pw+058323470625423+5#
#pw+429257443744651+6#
I tryed "all" But i cant figure out how to do it.
Basicly it would be fine just to read from line 8 -> 13 But how ?
Heres the code i'm using to read the textfile:
Dim FileLength
Open "code.txt" For Input As #1
FileLength = LOF(1)
var1 = Input(FileLength, #1)
calcedcodes.Text = var1
Close #1
I'm realy kind of new to VB so plz take it from the top
Thx in advance
Edited by - Dr.Bizar on 7/26/2003 7:03:33 AM
Read And Count Lines In A Text Box
Often, you may need to know how many lines of text there are in
a multi-line textbox. While Visual Basic makes it easy to determine
how many paragraphs the textbox contains, using code like so:
Private Sub Command1_Click()
Dim myParas As Variant
myParas = Split(Text1, vbNewLine)
MsgBox UBound(myParas) + 1
End Sub
This code, as you can see, only parses out hard carriage returns;
whereas you want to know how many lines of text the control contains.
To accomplish this task, you'll need to resort to the SendMessageAsLong()
API function. This function conforms to the following syntax:
Private Declare Function SendMessageAsLong Lib "user32" _
Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, _
ByVal wParam As Long, ByVal lParam As Long) As Long
To obtain the number of lines, you pass in the EM_GETLINECOUNT
constant in the wMsg parameter. Declare this constant like this:
Const EM_GETLINECOUNT = 186
Finally, to use the function, pass in the handle to the textbox
from which you want to retrieve the line count, as well as the
wMsg we mentioned earlier. Example code might look like so:
Private Sub Command2_Click()
Dim lCount As Long
lCount = SendMessageAsLong(Text1.hWnd, EM_GETLINECOUNT, 0, 0)
MsgBox lCount
End Sub
Read First 6 Lines Of A Text File
I am sure reading from a file question has been asked before. But I am trying to read the first six lines of a file. Can someone give me a small example or any links ?
A VB turned PHP geek
How To Locate And Read A Txt File Containing Multiple Lines
hi , i am building a project that contains names of different people .. i have written it in a txt format line by line for example
Code:
david
harry
john
tom
catherine
the number of lines is variable this is my code to read it
Code:
Private Sub Command1_Click()
Dim nFileNum As Integer, sText As String, sNextLine As String, lLineCount As Long
nFileNum = FreeFile
Open "C:UserspannamDesktopNew Text Document.txt" For Input As nFileNum
lLineCount = 1
Do While Not EOF(nFileNum)
Line Input #nFileNum, sNextLine
sNextLine = sNextLine & vbCrLf
sText = sText & sNextLine
Loop
Text1.Text = sText
Close nFileNum
End Sub
but from this code i have to determine the location of the text file in the code itself. what would the code be if the user has to locate it manually ? plus all the text opens up in a single line ..how do i work around it ?
thanking you in advance
Read Random Lines From Text File
Hey does anyone know how when i calick a button on my form it will read a random line from a text file that i created and insert it in to a text box?
Thanks For Any Help.
Load Ini File, Replace Some Lines, And Save It.
I am trying to open a .ini file to do a few line changes, it seems to work but I can't find a "simple" way to save it back to the file. It's curently in a variable called Otext as String. If I use Print Otext , the right thing appears but I have to send that to a file. Please help.
Thanks
Joel
Text File With 10 Lines, Want To Read And Display Only Second Line ... How?
Newbie question: I have a textfile (mytext.txt) containing 10 lines total: I have successfully coded how to read and display the first line OR all lines from the text file ... Next Step: How/What would I code to read and print say, only the second line?
Here's what I have:
Quote:
Option Explicit
Dim sampleoutput As String
Private Sub Command1_Click()
'Reads and displays first line from text file.
Open "C:My DocumentsPOS405dbtxtsamplemytext.txt" For Input As #1
Input #1, sampleoutput
Picture1.Print ""
Picture1.Print sampleoutput
Close #1
End Sub
Private Sub Command2_Click()
'Runs a loop to read and display all lines from text file.
Open "C:My DocumentsPOS405dbtxtsamplemytext.txt" For Input As #1
Do While Not EOF(1)
Input #1, sampleoutput
Picture1.Print sampleoutput
Loop
Close #1
End Sub
Private Sub Command3_Click()
'This code needs modification to read and display second line from text file.
Open "C:My DocumentsPOS405dbtxtsamplemytext.txt" For Input As #1
Input #1, sampleoutput
Picture1.Print ""
Picture1.Print sampleoutput
Close #1
End Sub
Thank you for any help.
~ Juanita
WebBrowser Fill Form - Too Many Lines - Read HTML From File?
Ok. I am trying to auto fill this form online using WebBrowser.Document statements.
Here is what I was trying becuase VB would not let me paste the whole chunk of text as a string. So I tried breaking it up and got another massage tellime too many lines continues.
VB Code:
WebBrowser2.Document.getElementById("text").Value = _& "<td colspan=4><p> <strong><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif">Asking _& Price:</font></strong><em><strong><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif"> _& </font></strong></em><strong><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif">$239,000</font></strong></p></td> _& <td width=780 height=29 colspan=5> <p align="center"><strong><font face="Verdana, Arial, Helvetica, sans-serif">Beautifull _& 1,400 Sq Ft Home 45Min from Las Vegas!</font></strong></p></td> _& </tr> _& <tr> _& <td width=780 height=267 colspan=3 valign="top"><img src="img/2381_small.jpg" width=204 height=267> _& </td> _& <td> <img src="img/m13.jpg" width=20 height=267></td> _& <td colspan=5 valign="top"><p> </p> _& <p><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Two story _& home on 1/2 acre. 2 Car garage. 5 Car carport. Circle drive. 3 Beddroom, _& 3 Full Baths. 1400 sq ft. Desert landscaping.<br> _& Perfect Vegas Gettaway! Located in Pahrump 45min from the strip. </font></p> _& <font face="Verdana, Arial, Helvetica, sans-serif"> _& <p><font size="-1">MUST SELL!!! Relocating to Oregon. This home is a BARGIN _& at only $239,000.00</font></p> _& <p><font size="-1">Stop by and see for yourself: 2381 S. Mallard Ave, Pahrump _& NV. 89048</font></p> _& <p><font size="-1">Call Jason at 702-515-9892<br> _& Or email: <a href="mailto:jason@infintium.org">jason@infintium.org</a></font></p> _& <p> </p> _& <p><font size="2">Website Links:</font></p> <p><font size="2"><a href="http://www.adpost.com/us/homes_offices/17558">http://www.adpost.com/us/homes_offices/17558</a></font></p> <p><font size="2"><a href="http://lasvegas.craigslist.org/rfs/172693874.html">http://lasvegas.craigslist.org/rfs/172693874.html</a></font></p> <p><font size="2"><a href="http://lasvegas.craigslist.org/rfs/174368285.html">http://lasvegas.craigslist.org/rfs/174368285.html</a></font></p> </font></td> </tr> <tr> <td width=780 height=834 colspan=9><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="3"> </td> </tr> <tr> <td><div align="center"><a href="img/Picture-002_small.jpg"><img src="img/Picture-002_small.jpg" width="240" height="180" border="0"></a></div></td> <td><div align="center"><a href="img/Picture-010_small.jpg"><img src="img/Picture-010_small.jpg" width="240" height="180" border="0"></a></div></td> <td><div align="center"><a href="img/Picture-004_small.jpg"><img src="img/Picture-004_small.jpg" width="240" height="180" border="0"></a></div></td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> <tr> <td><div align="center"><a href="img/Picture-002_inside_small.jpg"><img src="img/Picture-002_inside_small.jpg" width="240" height="180" border="0"></a></div></td> <td><div align="center"><a href="img/Picture-003_inside_small.jpg"><img src="img/Picture-003_inside_small.jpg" width="240" height="180" border="0"></a></div></td> <td><div align="center"><a href="img/Picture-006_inside_small.jpg"><img src="img/Picture-006_inside_small.jpg" width="240" height="180" border="0"></a></div></td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> <tr> <td><div align="center"><a href="img/Picture-013_inside_small.jpg"><img src="img/Picture-013_inside_small.jpg" width="240" height="180" border="0"></a></div></td> <td><div align="center"><a href="img/Picture-010_inside_small.jpg"><img src="img/Picture-010_inside_small.jpg" width="240" height="180" border="0"></a></div></td> <td><div align="center"><a href="img/Picture-011_inside_small.jpg"><img src="img/Picture-011_inside_small.jpg" width="240" height="180" border="0"></a></div></td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> <tr> <td height="180"><div align="center"><a href="img/Picture-012_inside_small.jpg"><img src="img/Picture-012_inside_small.jpg" width="240" height="180" border="0"></a></div></td> <td><div align="center"><a href="img/Picture-008_inside_small.jpg"><img src="img/Picture-008_inside_small.jpg" width="240" height="180" border="0"></a></div></td> <td><div align="center"><a href="img/Picture-009_inside_small.jpg"><img src="img/Picture-009_inside_small.jpg" width="240" height="180" border="0"></a></div></td> </tr> <tr> <td height="19" colspan="3"> </td> </tr> <tr> <td height="19" colspan="3"><div align="center"><a href="http://extremetracking.com/open?login=infintiu"target="_top"><img src="http://t1.extreme-dm.com/i.gif"name="EXim" border="0" height="38" width="41"alt="eXTReMe Tracker"></img></a> <script type="text/javascript" language="javascript1.2"><!--EXs=screen;EXw=EXs.width;navigator.appName!="Netscape"?EXb=EXs.colorDepth:EXb=EXs.pixelDepth;//--></script> <script type="text/javascript"><!--var EXlogin='infintiu' // Loginvar EXvsrv='s10' // VServernavigator.javaEnabled()==1?EXjv="y":EXjv="n";EXd=document;EXw?"":EXw="na";EXb?"":EXb="na";EXd.write("<img src=http://e1.extreme-dm.com","/"+EXvsrv+".g?login="+EXlogin+"&","jv="+EXjv+"&j=y&srw="+EXw+"&srb="+EXb+"&","l="+escape(EXd.referrer)+" height=1 width=1>");//--></script> <noscript> <img height="1" width="1" alt=""src="http://e1.extreme-dm.com/s10.g?login=infintiu&j=n&jv=n"/> </noscript> </div></td> </tr> </table> </td>
If there a way to have this data be pasted in from a text file? or better yet, read it from a .html file as that would be the best way.
:::: OR ::::
Is there a way to declare a VERY VERY long string? Very long like a whole html file?
Help me plese. Thanks.
Save Array Data As A Text File Of 65 Characters Lines
Um Ubound(M) 'where M() is an array of bytes.
To save content of M as a text file where lines are 34 characters each(the last one will be 34 chrs or less), I can write the following code:
Open MyFile For Binary As #1
rew = StrConv(M, vbUnicode)
For i = 0 To (Um + 1) 34 - 1
Put #1, , Mid(rew, i * 34 + 1, 34) & _ vbCrLf
Next i
Put #1, , Right(rew, Len(rew) Mod 34)
Close #1
AY mentionned the CopyMemory function but I can't make it work if original data is contained in an array
thank you
How Do I Read From The Registry?
How do I read from the Registry?
I want to ready this key:
HKEY_LOCAL_MACHINESOFTWAREMicrosoftOffice11.0ExcelInstallRoot
Name: Path
Type: REG_SZ
Data: C:Program FilesMicrosoft OfficeOFFICE11
Some on please help!
Thank you for your time and help.
Save To Registry
I'm trying to save a Combo Box List in the Registry. My code creates the place in the Registry, but under Data, in the Registry there is nothing. Also I'm not sure if my code is right to load the list with Form Load. This is what I have so far. Thanks for any help.
_____________________________________________________________
Private Sub OKButton_Click()
Form1.combo.AddItem AddExercisedlg.Addtxt, AddExercisedlg.ListIndex
SaveSetting "Max Workout Program", "Exercise", "List", Form1.combo.List(Form1.combo.ListIndex)
Unload Me
End Sub
_____________________________________________________________
Sub LoadList()
GetSetting "Max Workout Program", "Exercise", "List", combo.List(combo.ListIndex)
End Sub
Read From Registry?
I have been trying to figure out how to save and read from the registry. I have done alot of looking around at all the post and have put together the code below. It saves in the registry just fine but I can not seam to be able to read it back into my program for some reason. What do I have wrong?
Code:
Private Sub Command1_Click()
UName = UNtxt.Text
Password = Ptxt.Text
SaveSetting "Program143", "Pass", Password, UName
End Sub
Private Sub Command2_Click()
UNtxt = GetSetting("Program143", "Pass", "UName")
Ptxt = GetSetting("Program143", "Pass", "Password")
End Sub
|