simple how to get a commondialog to print an image to a picture box a txt file is easy but what about a .gif or .ico file.
simple how to get a commondialog to print an image to a picture box a txt file is easy but what about a .gif or .ico file.
Use LoadPicture function
Picture1.picture=Loadpicture(Commondialog1.Filename)
no problem
Code:Set Picture1.Picture = LoadPicture(commondialog1.FileName)
Just incase you're interesed, you can save the Picture again by using the SavePicture method.
Code:SavePicture Picture1.Picture, "C:\MyPicture.bmp"
Thank you Thank you Thank you. Yes i needed that.Quote:
Originally posted by Megatron
Just incase you're interesed, you can save the Picture again by using the SavePicture method.
Code:SavePicture Picture1.Picture, "C:\MyPicture.bmp"
Any ideas on how to do the same thing with textQuote:
Originally posted by adam3000
Thank you Thank you Thank you. Yes i needed that.Quote:
Originally posted by Megatron
Just incase you're interesed, you can save the Picture again by using the SavePicture method.
Code:SavePicture Picture1.Picture, "C:\MyPicture.bmp"
save it to a spot on a file of some kind?
To save a Text File
To load a Text FileCode:Open "C:\MyFile.txt" For Output As #1
Print #1, Text1
Close #1
Code:Open "C:\MyFile.txt" For Input As #1
Text1 = Input(LOF(1), 1)
Close #1
Is there a way to save the text from a specific text box into a specific spot on an html or asp page?Quote:
Originally posted by Megatron
To save a Text File
To load a Text FileCode:Open "C:\MyFile.txt" For Output As #1
Print #1, Text1
Close #1
Code:Open "C:\MyFile.txt" For Input As #1
Text1 = Input(LOF(1), 1)
Close #1
Yep, you could open in binary
Code:Open Filehtml for binary as #1
Buffer=space(lof(1)-yourposition+1)
Get #1,yourposition,Buffer
Put #1,yourposition,Text1
Put #1,Buffer
close 1
How does this work. how is the position specified in the html or asp page?Quote:
Originally posted by kedaman
Yep, you could open in binary
Code:Open Filehtml for binary as #1
Buffer=space(lof(1)-yourposition+1)
Get #1,yourposition,Buffer
Put #1,yourposition,Text1
Put #1,Buffer
close 1
What it does is open your file, filename specified in filehtml string. Buffers the rest of the file that starts from yourposition, puts the text in textbox text1 at yourposition and then put the rest of the buffer after the text. (Exactly as you wanted it to do?)
hmm, replace
Put #1,Buffer
with
Put #1,,Buffer
YOu specify the position in bytes, the location in the file
Thank you, Ill give it a try.Quote:
Originally posted by kedaman
What it does is open your file, filename specified in filehtml string. Buffers the rest of the file that starts from yourposition, puts the text in textbox text1 at yourposition and then put the rest of the buffer after the text. (Exactly as you wanted it to do?)
hmm, replace
Put #1,Buffer
with
Put #1,,Buffer
YOu specify the position in bytes, the location in the file
Anyone got any idea how to read a possition on an html page in bytes?????????????????///////Quote:
Originally posted by adam3000
Thank you, Ill give it a try.Quote:
Originally posted by kedaman
What it does is open your file, filename specified in filehtml string. Buffers the rest of the file that starts from yourposition, puts the text in textbox text1 at yourposition and then put the rest of the buffer after the text. (Exactly as you wanted it to do?)
hmm, replace
Put #1,Buffer
with
Put #1,,Buffer
YOu specify the position in bytes, the location in the file
I thought that was what you had to specify, in your html page, do you have any particular text on which you can use for a reference point?Quote:
Anyone got any idea how to read a possition on an html page in bytes?
Ok lets say i use a particular text on which to use as a reference point how would you write that?Quote:
Originally posted by kedaman
I thought that was what you had to specify, in your html page, do you have any particular text on which you can use for a reference point?Quote:
Anyone got any idea how to read a possition on an html page in bytes?
Well, assuming you just have one Reference point:
Code:Open Filehtml for binary as #1
Buffer=space(lof(1))
Get #1,,Buffer
Parts=Split(Buffer,RefText)
Put #1,len(Part(0))+1,RefText & Text1 & Part(1)
For N=2 to ubound(Parts)
Put #1,,Parts(N)
Next N
close 1
Open "H:\wwwroot\softwaretest2.asp" For Binary As #1Quote:
Originally posted by kedaman
Well, assuming you just have one Reference point:
Code:Open Filehtml for binary as #1
Buffer=space(lof(1))
Get #1,,Buffer
Parts=Split(Buffer,RefText)
Put #1,len(Part(0))+1,RefText & Text1 & Part(1)
For N=2 to ubound(Parts)
Put #1,,Parts(N)
Next N
close 1
Buffer = Space(LOF(1))
Get #1, , Buffer
Parts = Split(Buffer, thistext)
Put #1, Len(Part(0)) + 1, thistext & txtName1.Text & Part(1)
For N = 2 To UBound(Parts)
Put #1, , Parts(N)
Next N
Close 1
Like that?
yep, if you have the correct variables, have you tested it?
So I have to Dim Buffer, Parts, thistext(As String) and PartQuote:
Originally posted by kedaman
yep, if you have the correct variables, have you tested it?
It says method or data member not found for txtName1.text but that does exist on that form. Thats wiered its telling me my only options for that are Count, Item, LBound, and UBound. Ill try Item. But it still sayes argument not optional. hmmmm.
hmm interesting that ubound pops up as an expected arayQuote:
Originally posted by adam3000
So I have to Dim Buffer, Parts, thistext(As String) and PartQuote:
Originally posted by kedaman
yep, if you have the correct variables, have you tested it?
It says method or data member not found for txtName1.text but that does exist on that form. Thats wiered its telling me my only options for that are Count, Item, LBound, and UBound. Ill try Item. But it still sayes argument not optional. hmmmm.
Can i use just one item in a multidimentional array like this???Quote:
Originally posted by adam3000
hmm interesting that ubound pops up as an expected arayQuote:
Originally posted by adam3000
So I have to Dim Buffer, Parts, thistext(As String) and PartQuote:
Originally posted by kedaman
yep, if you have the correct variables, have you tested it?
It says method or data member not found for txtName1.text but that does exist on that form. Thats wiered its telling me my only options for that are Count, Item, LBound, and UBound. Ill try Item. But it still sayes argument not optional. hmmmm.
You could press reply instead of quote when you reply something ;) that's if you don't want to have those quotes there.
Parts should be a variant containing the array. Thistext can be for instance a textbox or just a string,
Ubound works with multidimensional arrays too, you just specify the dimension index in the second argument.Code:Dim Parts, Buffer as string,n as integer
Open "H:\wwwroot\softwaretest2.asp" For Binary As #1
Buffer = Space(LOF(1))
Get #1, , Buffer
Parts = Split(Buffer, thistext)
Put #1, Len(Parts(0)) + 1, thistext & txtName1.Text & Parts(1)
For N = 2 To UBound(Parts)
Put #1, , Parts(N)
Next N
Close 1
hehe hi
got this http://www.xitinc.com/softwaretest2.asp
guess i messed up somewhere i only get boxes instead of text this is the code i used:
Dim Parts, Buffer As String, n As Integer
Open "H:\wwwroot\softwaretest2.asp" For Binary As #1
Buffer = Space(LOF(1))
Get #1, , Buffer
Parts = Split(Buffer, "thistext")
Put #1, Len(Parts(0)) + 1, "thistext" & txtName1.Count & Parts(1)
For n = 2 To UBound(Parts)
Put #1, , Parts(n)
Next n
Close 1
i used txtName1.Count instead of txtName1.text because the it sayes method or data memeber not found.
.count? So you have a control array? No you should put the string you wanted at the spot on your html:
Or is it the count of controls you want to have there?Quote:
Any ideas on how to do the same thing with text
save it to a spot on a file of some kind?
you could just store the position you got earlier, + the keyfrase and then write again as you want to update