Hi there,

I'm trying to write a application that needs to create a site structure on
my sharepoint portal server 2004. I have the SDK but don't seem to get the
application to login to sharepoint. Anyone out there with some information
on this?

I have been trying to use the LogonUser from the Win32 API, but when the
application has to run on a different machine than than my sharepoint
installation I can't use that method. Does Sharepoint provide any interface
from which it is possible to logon? Or how is it possible to perform such a
programmatically login?

p.s I write the application in C#

Thanks in regards,
Jess

RE: Programmatically login to sharepoint by DonShults

DonShults
Mon Jan 31 14:45:04 CST 2005

Jess,

I have an app that uses the SharePoint Web Services Interface. In order to
connect to SharePoint you need to authenticate with the server. Here some
code that I use,

Public Sub SetCredentials()
Try
WebsService.Credentials =
System.Net.CredentialCache.DefaultCredentials
Catch ex As Exception
RaiseEvent WebServiceError(ex.Message.ToString)
MsgBox("Error: " & ex.Message)
End Try

End Sub

I have created a Web Service Object and I pass in the credentials of the
currently logged in user. (See MSDN for: System.Net.Credentials for more
info.)

Hope that helps..

Don

"languy" wrote:

> Hi there,
>
> I'm trying to write a application that needs to create a site structure on
> my sharepoint portal server 2004. I have the SDK but don't seem to get the
> application to login to sharepoint. Anyone out there with some information
> on this?
>
> I have been trying to use the LogonUser from the Win32 API, but when the
> application has to run on a different machine than than my sharepoint
> installation I can't use that method. Does Sharepoint provide any interface
> from which it is possible to logon? Or how is it possible to perform such a
> programmatically login?
>
> p.s I write the application in C#
>
> Thanks in regards,
> Jess
>
>
>