Path: csiph.com!au2pb.net!feeder.erje.net!1.eu.feeder.erje.net!nntpspool01.opticnetworks.net!aioe.org!.POSTED!not-for-mail From: "Vittorio" Newsgroups: it.comp.java Subject: =?iso-8859-1?Q?c'=E8_anche_in_java_una_simile_sintassi=3F?= Date: Mon, 12 Oct 2015 23:12:25 +0200 Organization: Aioe.org NNTP Server Lines: 20 Message-ID: NNTP-Posting-Host: i1PbpcWCp5nxLvpab3q4ug.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org X-MimeOLE: Produced By Microsoft MimeOLE V16.4.3528.331 X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: Microsoft Windows Live Mail 16.4.3528.331 Importance: Normal X-Priority: 3 X-MSMail-Priority: Normal Xref: csiph.com it.comp.java:8613 E' codice C# . Serve per impostare le due proprietà username\password ; Notare che Credentials è una interfaccia implementata dalla classe NetworkCredential, ma tale interfaccia non possiede le due proprietà username\password ( che sono possedute invece dalla classe NetworkCredential) ,per cui per impostarle si usa il costrutto con le due graffe. SmtpClient sc = new SmtpClient("hostpc",678); sc.Credentials = new System.Net.NetworkCredential() { UserName = "ffff", Password = "fhy" }; Ciao