Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

Call service in .NET with authentication

$
0
0

I have a service written in .NET using VB.NET which returns a datatable. To make it safer, I added some users to web.config:

<!-- <authentication mode="Windows" /> --><authentication mode="Forms"><forms loginUrl="~/Login.aspx" timeout="2880"><credentials passwordFormat="Clear"><user name="admin" password="admin" /></credentials></forms></authentication><authorization><deny users="?"/></authorization>

Now if I want to call it from my Windows Forms that has a reference to the service via project (right click, add service references....),but serviceCredential is readonly.

 Dim credentials As New NetworkCredential("admin")    s.ClientCredentials = credentials

Any solutions? Thanks


Viewing all articles
Browse latest Browse all 12111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>