Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > it.comp.lang.visual-basic > #19146

Re: C#/VBnet Scrittura file INI che non scrive correttamente \

X-Received by 10.129.178.129 with SMTP id q123mr15417552ywh.109.1505458768284; Thu, 14 Sep 2017 23:59:28 -0700 (PDT)
X-Received by 10.31.151.65 with SMTP id z62mr258913vkd.19.1505458768237; Thu, 14 Sep 2017 23:59:28 -0700 (PDT)
Path csiph.com!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!q8no614550qtb.0!news-out.google.com!a26ni520qta.0!nntp.google.com!b1no616858qtc.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups it.comp.lang.visual-basic
Date Thu, 14 Sep 2017 23:59:27 -0700 (PDT)
In-Reply-To <opee0t$t71$1@virtdiesel.mng.cu.mi.it>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=95.248.51.211; posting-account=eitZdgoAAAC6C9CXmyhLNaQM3MgI3eZM
NNTP-Posting-Host 95.248.51.211
References <opee0t$t71$1@virtdiesel.mng.cu.mi.it>
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <7f22ccce-3db1-4d6c-8fa0-99a5c579516e@googlegroups.com> (permalink)
Subject Re: C#/VBnet Scrittura file INI che non scrive correttamente \
From Luca D <antaniserse@yahoo.it>
Injection-Date Fri, 15 Sep 2017 06:59:28 +0000
Content-Type text/plain; charset="UTF-8"
Content-Transfer-Encoding quoted-printable
Lines 25
Xref csiph.com it.comp.lang.visual-basic:19146

Show key headers only | View raw


On Thursday, September 14, 2017 at 7:24:47 PM UTC+2, RobertoA wrote:
> Sto cercando di scrivere una configurazione su un file ini
> Per la scrittura uso la solita WritePrivateProfileString:
> 
> [DllImport("kernel32", CharSet = CharSet.Unicode)]
> static extern long WritePrivateProfileString(string Section, string Key, 
> string Value, string FilePath);
> 
> public void Write(string Key, string Value, string Section )
>     { WritePrivateProfileString(Section, Key, Value, Path);}
> 	
> Bon funziona tutto ad eccezione di quando tento di scrivere come Value 
> una directory con i backslash del tipo c:\peppe\mariuccia
> I caratteri \ (dec 92) contenuti nella stringa passata al parametro 
> Value vengono probabilmente interpretati come fine stringa e nel file 
> ini mi ritrovo un CR (dec  13)
> Come l'e' sta roba qua?

E' una vita che non uso quelle funzioni ma è probabile tu debba fare l'escape dei \ in \\

Detto questo, hai qualche requisito di retrocompatibilità particolare che ti costringe ancora ad usare gli INI? perchè tra xml serializetion e altro, puo fare le stesse cose con 4 righe e meno mal di testa (vedi altro topic con trigger dell'antivirus)

Back to it.comp.lang.visual-basic | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

C#/VBnet Scrittura file INI che non scrive correttamente \ RobertoA <amorosik@tiscalinet.it> - 2017-09-14 19:38 +0200
  Re: C#/VBnet Scrittura file INI che non scrive correttamente \ Luca D <antaniserse@yahoo.it> - 2017-09-14 23:59 -0700
    Re: C#/VBnet Scrittura file INI che non scrive correttamente \ RobertoA <amorosik@tiscalinet.it> - 2017-09-15 11:34 +0200
      Re: C#/VBnet Scrittura file INI che non scrive correttamente \ Luca D <antaniserse@yahoo.it> - 2017-09-16 01:14 -0700

csiph-web