Proprietà ReportServerCredentials.NetworkCredentials
Recupera o imposta le credenziali di rete utilizzate per l'autenticazione con il server di rapporti.
Spazio dei nomi Microsoft.Reporting.WinForms
Assembly: Microsoft.ReportViewer.WinForms (in Microsoft.ReportViewer.WinForms.dll)
Sintassi
'Dichiarazione
Public Property NetworkCredentials As ICredentials
Get
Set
'Utilizzo
Dim instance As ReportServerCredentials
Dim value As ICredentials
value = instance.NetworkCredentials
instance.NetworkCredentials = value
public ICredentials NetworkCredentials { get; set; }
public:
virtual property ICredentials^ NetworkCredentials {
ICredentials^ get () sealed;
void set (ICredentials^ value) sealed;
}
abstract NetworkCredentials : ICredentials with get, set
override NetworkCredentials : ICredentials with get, set
final function get NetworkCredentials () : ICredentials
final function set NetworkCredentials (value : ICredentials)
Valore proprietà
Tipo: System.Net.ICredentials
Oggetto NetworkCredentials contenente le credenziali di rete utilizzate per l'autenticazione con il server di rapporti.
Implementa
IReportServerCredentials.NetworkCredentials
Esempi
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Net;
namespace ReportServerCredentialsSample
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
reportViewer1.ProcessingMode =
Microsoft.Reporting.WinForms.ProcessingMode.Remote;
reportViewer1.ServerReport.ReportPath =
@"/Adventureworks Sample Reports/Company Sales";
NetworkCredential myCred = new
NetworkCredential(<UserName>, <Password>, <DomainName>);
reportViewer1.ServerReport.ReportServerCredentials.NetworkCredentials =
myCred;
reportViewer1.RefreshReport();
}
}
}