Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 02:46

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Help]Read .ini from a website

Discussion on [Help]Read .ini from a website within the CO2 Private Server forum part of the Conquer Online 2 category.

Closed Thread
 
Old   #1
 
elite*gold: 0
Join Date: Sep 2008
Posts: 1,683
Received Thanks: 506
[Help]Read .ini from a website

Source: LOTF v2
Need Help With:
Since the database is being read from a .ini, I was hoping I could make it read the .ini from a website (e.g. localhost/co/servername/config.ini (I know localhost isn't a good example)).


I have no idea how to make this, I know this seems kinda useless, but there is a reason I'm using for something, which I is private for now. I think I will release it after finishing it 100%.

~Bas
Basser is offline  
Old 08/28/2009, 23:35   #2
 
elite*gold: 20
Join Date: Apr 2008
Posts: 2,281
Received Thanks: 913
You would have to download the .ini file, then read it, then delete it.
kinshi88 is offline  
Thanks
1 User
Old 08/28/2009, 23:40   #3
 
elite*gold: 0
Join Date: Sep 2008
Posts: 1,683
Received Thanks: 506
Err okay, but how to?
Basser is offline  
Old 08/29/2009, 00:16   #4
 
elite*gold: 20
Join Date: Apr 2008
Posts: 2,281
Received Thanks: 913
Code:
using System.Net;
Code:
WebClient Downloader = new WebClient();
Downloader.DownloadFile("localhost/co/servername/config.ini", "config.ini");
Then read the Database and load what you need.

Then Delete:
Code:
File.Delete(Application.StartupPath + @"/config.ini");
Something like that.
kinshi88 is offline  
Thanks
1 User
Old 08/29/2009, 11:43   #5
 
elite*gold: 0
Join Date: Sep 2008
Posts: 1,683
Received Thanks: 506
Quote:
Originally Posted by kinshi88 View Post
Code:
using System.Net;
Code:
WebClient Downloader = new WebClient();
Downloader.DownloadFile("localhost/co/servername/config.ini", "config.ini");
Then read the Database and load what you need.

Then Delete:
Code:
File.Delete(Application.StartupPath + @"/config.ini");
Something like that.
Except for the save location, it worked, however the File.Delete didn't work, but I figured out how to add it.

Thanks a lot, this really helped me out.


#request close
Basser is offline  
Old 08/29/2009, 21:35   #6
 
unknownone's Avatar
 
elite*gold: 20
Join Date: Jun 2005
Posts: 1,013
Received Thanks: 381
Bit of a backwards solution. Ideally you should create an Ini reading class which takes a System.IO.Stream argument rather then using those unmanaged imports. The GetPrivateProfileString etc are really Windows Registry functions, but luckily compatible with COs ini files.

There are already some other managed Ini reading libraries that will take a stream. Quick google search should find one. Using a managed ini reader has plenty of advantages, such as exception handling, where you can actually see what a problem is, rather then obtaining a "0" meaning error, with no explanation.

If you do grab one, you could use a HttpWebRequest and HttpWebResponse to collect the file, use response.GetStream() to get a stream you can pass to the ini reader. This also has the advantage that you can do it asynchronously.
unknownone is offline  
Thanks
1 User
Old 09/02/2009, 06:36   #7
 
elite*gold: 20
Join Date: Apr 2008
Posts: 2,281
Received Thanks: 913
#Moved
kinshi88 is offline  
Thanks
1 User
Old 09/02/2009, 11:22   #8
 
elite*gold: 0
Join Date: Sep 2008
Posts: 1,683
Received Thanks: 506
Kinshi's solution was fine, I've got it working, it just takes some time to load the ini, but that doesn't matter since I never use it myself, it's a security thing.
Basser is offline  
Old 09/03/2009, 06:19   #9
 
elite*gold: 0
Join Date: Jan 2009
Posts: 1,922
Received Thanks: 491
Wait, May i know the reason why you are doing this?
PeTe Ninja is offline  
Old 09/03/2009, 11:15   #10
 
elite*gold: 0
Join Date: Sep 2008
Posts: 1,683
Received Thanks: 506
As I said before, this is private, and I probably won't release it.
Basser is offline  
Old 09/03/2009, 11:16   #11
 
elite*gold: 0
Join Date: Sep 2008
Posts: 1,683
Received Thanks: 506
#request close
Basser is offline  
Old 09/04/2009, 03:25   #12
 
elite*gold: 20
Join Date: Apr 2008
Posts: 2,281
Received Thanks: 913
#Closed
kinshi88 is offline  
Closed Thread


Similar Threads Similar Threads
Erstelle eure WebSite / Create your Website
10/20/2010 - elite*gold Trading - 39 Replies
Hallo Community, Aktuelle Treasures No permission - GEKAUFT No permission - OFFEN Da ich genügend Zeit habe, und neben nach neuen Herrausforderungen suche, bietet ich ab heute meinen Website Service an.
READ READ READ !!! LORDYK93 SCAMMER
10/11/2009 - Silkroad Online Trading - 1 Replies
he scammed a ecsro vip account from me ... he wanna give a lvl 90 sjsro account he change the pw of my account and said i have to wait ... now hes on at epvpers and on in msn but he didnt answer me anymore if you answer me and give me my vip account back i will delete this.!
[request] website coding help Read!
02/12/2009 - CO2 Private Server - 20 Replies
heey I have an question can somone make an config and reg page for TQ binarys in html coding becouse the .php is released already. if somone can help me add me on msn or leave an replay my mail is [email protected]



All times are GMT +1. The time now is 02:46.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.