| Mirage Source http://www.miragesource.net/forums/ |
|
| Read INI's from web server? http://www.miragesource.net/forums/viewtopic.php?f=210&t=435 |
Page 1 of 1 |
| Author: | Leighland [ Sat Aug 26, 2006 2:07 am ] |
| Post subject: | Read INI's from web server? |
I want to know if it's possible to read INI data from a webserver or FTP. I know how to read files, I just don't knwo how to read specific information from them. Example: I want to open News.ini from valaron.awardspace.com News.ini looks like this: Code: [News]
News=No news for today, sorry! [MOTD] Motd=Message of the day: You are here! I want to read the news and show it on the main menu, then after log in, read the Motd and display it in the chat box... just not sure how I would do that. Any help would be appreciated |
|
| Author: | Not2BeTrusted2 [ Fri Sep 01, 2006 10:04 pm ] |
| Post subject: | |
yea i think it is possible.. but this is how i would do it =p i would put a control for webbrowser in my program and make it invisible so u only receive information from it like that |
|
| Author: | Leighland [ Sat Sep 02, 2006 3:15 am ] |
| Post subject: | |
Mind explaining that... or to steal a quite from you "yea ok i cant find any tutorials so can some1 juss gimmi the codes like the subs/functions/types" |
|
| Author: | grimsk8ter11 [ Sat Sep 02, 2006 1:35 pm ] |
| Post subject: | |
use INet to download the file from the webserver, then use putvar/getvar. thats what hes saying, and yes, it will work. |
|
| Author: | Matt [ Sat Sep 02, 2006 2:32 pm ] |
| Post subject: | |
You might be able to substitute the app.path part, with the inet url, and maybe, it will work. I will try in a bit. |
|
| Author: | Reece [ Sat Sep 02, 2006 5:18 pm ] |
| Post subject: | |
Easy. Upload a html with your news in and call it news.html In componts look for thease [img] http://img417.imageshack.us/img417/3029/msconpbb4.gif [/img] put then both in the projects form where you want them. Call the browser brow1 add this code to form load Code: brow1.navigate "http://urlhere" If you want it to activate on command click then it will be Code: Private sub cmdbutton_click
browser1.navigate "urlhere" end sub I cleaned this up, if you have any questions just ask |
|
| Author: | Leighland [ Mon Sep 04, 2006 6:13 pm ] |
| Post subject: | |
Okay, I'll try that when I get the chance, thanks. |
|
| Author: | Matt [ Mon Sep 04, 2006 6:52 pm ] |
| Post subject: | |
Okay, that reads the stuff, but the game won't read it as an ini file. Does anyone know how to read an ini type file from a text box in VB? |
|
| Author: | Reece [ Mon Sep 04, 2006 7:06 pm ] |
| Post subject: | |
inis are slow, thats alot easier. No need to update the ini just the webpage |
|
| Author: | Matt [ Tue Sep 05, 2006 1:00 am ] |
| Post subject: | |
I don't see how that would work, maybe you could explain it to me. And if you want faster, just go with access or go with mysql. |
|
| Author: | Reece [ Tue Sep 05, 2006 10:42 am ] |
| Post subject: | |
What this does is reads directly from a webpage. The two componatns i tell you to add is to allow a webpage in your form. This is a very simple tutrorial but i used this to make my webbrowser for my school project |
|
| Author: | grimsk8ter11 [ Tue Sep 05, 2006 11:04 am ] |
| Post subject: | |
Code: Public Function DownloadFile(srcFileName As String, targetFileName As String)
Dim Size As Long, Remaining As Long, FFile As Integer, Chunk() As Byte If Trim(targetFileName) <> "" Then If Extension <> "" Then If Mid(Extension, 1, 1) = "\" Or Mid(Extension, 1, 1) = "/" Then Extension = Mid(Extension, 2, Len(Extension)) If Mid(Extension, Len(Extension), Len(Extension)) = "\" Or Mid(Extension, Len(Extension), Len(Extension)) = "/" Then Extension = Mid(Extension, 1, Len(Extension) - 1) If LCase(Dir(App.Path & "\" & Extension, vbDirectory)) <> LCase(Extension) Then Call MkDir(App.Path & "\" & Extension) End If Else targetFileName = targetFileName End If frmUpdate.Inet.Execute Path & srcFileName, "GET" Do While frmUpdate.Inet.StillExecuting DoEvents Loop Size = Val(frmUpdate.Inet.GetHeader("Content-Length")) Remaining = 0 FFile = FreeFile If Extension <> "" Then Open App.Path & "\" & Extension & "\" & targetFileName For Binary Access Write As #FFile Else Open App.Path & "\" & targetFileName For Binary Access Write As #FFile End If Do Until Remaining >= Size If Size - Remaining > 1023 Then Chunk = frmUpdate.Inet.GetChunk(1024, icByteArray) Remaining = Remaining + 1024 Else Chunk = frmUpdate.Inet.GetChunk(Size - Remaining, icByteArray) Remaining = Size End If Put #FFile, , Chunk If Size > 0 Then frmUpdate.Label4.Caption = Int(Str((Remaining / Size) * 100)) & "%" Loop Close #FFile DoEvents End If End Function thats from GSDs old updater, you should have no problem figuring out what needs to be chhanged around. (frmUpdate and removal of albels you dont have). It downloads the file to your directory and you can read it from there. |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|