NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 51 52 53 54 55 … 93 Next »
read/write ini files...

 
  • 0 Vote(s) - 0 Average
read/write ini files...
zehd
Offline

Posting Freak

Posts: 5,119
Threads: 249
Joined: Feb 2006
#1
2006-08-12, 11:28 AM
I'm coding with VB6

I've been surfing everywhere and found many ways to read and write to ini files, but all of the ways require a key:

Code:
[KEY1]
Value1=thing
Value2=etc

I want to be able to refer to just a Value without a key...

Why?

For example, comskip.ini has values, I'd like to read directly, and there's no Keys. If I add a key to the top, the comments that are 'semi-coloned out' are also retrieved...

I know that another way for me to read and write to text files, are to read the whole thing into a buffer, read/edit the value, and then write it back.

Before I crank on that one, is there an easier way?

I was also wanting to read write values in the config.xml. I suspect there's APIs that will help. And of course there's the messy, 'read text file, re-write new text file' method, but I can't find much on this..
Frank Z
[COLOR="Gray"]
I used to ask 'why?' Now I just reinstall...
[SIZE="1"]______________________________________________
Author: ZTools: ZProcess, MVPServerChecker; UltraXMLTV Enhancer, Renamer, Manager; [/SIZE]
[/COLOR]
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,626
Threads: 767
Joined: Nov 2003
#2
2006-08-12, 04:45 PM
Quote:I'm coding with VB6

I've been surfing everywhere and found many ways to read and write to ini files, but all of the ways require a key:


Code:
[KEY1]
Value1=thing
Value2=etc
I want to be able to refer to just a Value without a key...

Why?

For example, comskip.ini has values, I'd like to read directly, and there's no Keys. If I add a key to the top, the comments that are 'semi-coloned out' are also retrieved...
I was fairly sure there was a way to do this. Does using a app/section name of "" do it?
zehd
Offline

Posting Freak

Posts: 5,119
Threads: 249
Joined: Feb 2006
#3
2006-08-13, 05:48 AM
sub Wrote:I was fairly sure there was a way to do this. Does using a app/section name of "" do it?

Thanks for your reply, sub

I know what you're talking about. I have a reg read write that acts like that...

For ini files Several of the methods, most of which use

Private Declare Function GetPrivateProfileString _
Lib "kernel32" Alias "GetPrivateProfileStringA" _
(ByVal lpSectionName As String, _
ByVal lpKeyName As Any, _
ByVal lpDefault As String, _
ByVal lpbuffurnedString As String, _
ByVal nBuffSize As Long, _
ByVal lpFileName As String) As Long

Private Declare Function WritePrivateProfileString _
Lib "kernel32" Alias "WritePrivateProfileStringA" _
(ByVal lpSectionName As String, _
ByVal lpKeyName As Any, _
ByVal lpString As Any, _
ByVal lpFileName As String) As Long

(Seems I wrote incorrectly before - wasn't the 'key' that I was worried about, but the 'section'... But I think you were with me)

Anyway, I think this API does not allow for a null or empty string for 'Section'.

Doesn't error, just doesn't read or write without a 'Section'

Any other ideas?
Frank Z
[COLOR="Gray"]
I used to ask 'why?' Now I just reinstall...
[SIZE="1"]______________________________________________
Author: ZTools: ZProcess, MVPServerChecker; UltraXMLTV Enhancer, Renamer, Manager; [/SIZE]
[/COLOR]
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,626
Threads: 767
Joined: Nov 2003
#4
2006-08-13, 05:50 AM
Sorry, I dont really know. Its not something I've had to do.
zehd
Offline

Posting Freak

Posts: 5,119
Threads: 249
Joined: Feb 2006
#5
2006-08-13, 07:45 AM
mvandere Wrote:I'm pretty sure I remember looking at the Comskip source once.... and it reads and write the entire thing as a text file....


OK. Then that's what I'll be doing too..

----

And I'm starting to see that XML is a .net thing (is it native?)

Anyway, I suppose if I'm writing code for that 'dump the ini into a temp file and write back' solution, I could do the same for the GB-PVR XML, but I don't really like that...

Anyone know of APIs that access the XML, or do I need heavy duty modules, or dll/ocx ?

Thanks

(I suppose it might be time to jump into VB.net - is it difficult to switch? - I know there's an import wizard that's supposed to do quite well, but then I have to retrain MY brain...)
Frank Z
[COLOR="Gray"]
I used to ask 'why?' Now I just reinstall...
[SIZE="1"]______________________________________________
Author: ZTools: ZProcess, MVPServerChecker; UltraXMLTV Enhancer, Renamer, Manager; [/SIZE]
[/COLOR]
zehd
Offline

Posting Freak

Posts: 5,119
Threads: 249
Joined: Feb 2006
#6
2006-08-15, 02:49 PM
I'm worried that the free version of VB.NET will get me started, hooked, and then a feature that I want is only available in another, purchasable version.

I'm not about to pirate...

I own Enterprise VB6, although I don't really know if I've used anything specifically Enterprise.

BTW, what's wrong with padded rooms?
Frank Z
[COLOR="Gray"]
I used to ask 'why?' Now I just reinstall...
[SIZE="1"]______________________________________________
Author: ZTools: ZProcess, MVPServerChecker; UltraXMLTV Enhancer, Renamer, Manager; [/SIZE]
[/COLOR]
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Loading Local Video Files Syler 25 6,342 2021-03-07, 09:20 PM
Last Post: Syler
  sabnzbd plugin to show processed files Wakalaka 1 1,932 2013-03-12, 06:48 AM
Last Post: psycik
  Building a list of files in media folders (npvr Music and Videos) bgowland 2 1,849 2012-02-05, 10:29 AM
Last Post: bgowland
  Extracting data from XML files ACTCMS 4 2,311 2012-01-24, 12:16 AM
Last Post: sub
  NPVR batch files mvallevand 4 3,175 2010-11-27, 07:40 PM
Last Post: mvallevand
  uploading files to wiki pastro 3 1,693 2009-01-26, 02:27 AM
Last Post: Fatman_do
  MetaData: How to create, read, write zehd 4 2,300 2009-01-20, 04:11 PM
Last Post: sub
  Getting a drive's write speed pastro 2 1,815 2008-05-14, 09:13 PM
Last Post: pastro
  IRecordingSource - GBPVR locks files? blackpaw 6 2,420 2008-04-01, 04:09 AM
Last Post: blackpaw
  Skin Files - and Popup skin files psycik 1 1,241 2007-12-09, 03:16 PM
Last Post: sub

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode