Click here to Skip to main content
15,887,135 members
Home / Discussions / C#
   

C#

 
GeneralRe: ? Open an already opened file Pin
Heath Stewart21-Jul-04 6:24
protectorHeath Stewart21-Jul-04 6:24 
Generallock table in ms sql Pin
evoseven20-Jul-04 22:38
evoseven20-Jul-04 22:38 
GeneralRe: lock table in ms sql Pin
Nick Parker21-Jul-04 3:09
protectorNick Parker21-Jul-04 3:09 
GeneralRe: lock table in ms sql Pin
Steven Campbell21-Jul-04 3:16
Steven Campbell21-Jul-04 3:16 
GeneralRe: lock table in ms sql Pin
evoseven21-Jul-04 13:17
evoseven21-Jul-04 13:17 
QuestionWindows XP firewall influence the traffic of ActiveSync? Pin
ting66820-Jul-04 22:31
ting66820-Jul-04 22:31 
AnswerRe: Windows XP firewall influence the traffic of ActiveSync? Pin
Heath Stewart21-Jul-04 6:20
protectorHeath Stewart21-Jul-04 6:20 
GeneralWebRequest and customized .config Pin
Corinna John20-Jul-04 22:02
Corinna John20-Jul-04 22:02 
I have to search a public Exchange folder in a C# application.
The public folder is visible only for one user, so I tried to add Credentials to the web request,
as it is described in
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/_exch2k_searching_calendar_folders_webdav.asp ^:

<br />
MyCredentialCache = new System.Net.CredentialCache();<br />
MyCredentialCache.Add( new System.Uri("http://myFolderURI"),<br />
"NTLM",<br />
new System.Net.NetworkCredential(strUserName, strPassword, strDomain) );<br />
<br />
HttpWebRequest request = WebRequest.Create(myFolderURI);<br />
request.Credentials = MyCredentialCache;<br />


Exchange does not use the credentials. I may access the server, so the credentials are working. But Request.GetResponse() throws an exception "404 Not Found".

I checked the folder path in Outlook Web Access and found out that Exchange uses the login information I've entered only for the personal folders. For public folders my Windows authentication is used.
That means if Im logged on to Windows as user "A" and log on to Web Access as user "B", I see the personal folders of "B" and the public folders as if I were "A". The same applies to WebDAV. The credentials are only usedfor personal folders, but I cannot access the public folders that are visible to the user specified in the credentials.

So my application has to impersonate the user before accessing Exchange. This worked with CDO before, so I think it should work here, too.

<br />
myContext = myWindowsIdentity.Impersonate();<br />
WebRequest request = WebRequest.Create(strCalendarURI);<br />


Now WebRequest.Create throws an exception:
Exception in cofiguration handler (c:\windows\microsoft.net\framework\
v1.1.4322\Config\machine.config line 74)


machine.config contains a line proxy usesystemdefault="true", telling WebRequest to read the LAN settings from the registry.
This must fail, because the CURRENT_USER hive of the impersonated user is not loaded.
To override this setting I created a configuration file "appname.exe.config" in the /bin/Debug folder, but it changed nothing. My configuration file is not being used - What's wrong? Confused | :confused:

How can I access the public folder as anotehr user via WebDAV?
...get impersonation and the config file to work?
...get Exchange to accept my request credentials instead of using Windows Authentication?

Thanks for every hint,
coco
GeneralRe: WebRequest and customized .config Pin
Heath Stewart21-Jul-04 6:17
protectorHeath Stewart21-Jul-04 6:17 
GeneralStarting service from another Pin
SatyaDY20-Jul-04 19:38
SatyaDY20-Jul-04 19:38 
GeneralRe: Starting service from another Pin
Heath Stewart21-Jul-04 5:51
protectorHeath Stewart21-Jul-04 5:51 
GeneralProb with service Pin
SatyaDY20-Jul-04 18:00
SatyaDY20-Jul-04 18:00 
GeneralRe: Prob with service Pin
Heath Stewart21-Jul-04 4:50
protectorHeath Stewart21-Jul-04 4:50 
QuestionHow to do with SVG path string? Pin
luming112233445520-Jul-04 16:53
luming112233445520-Jul-04 16:53 
AnswerRe: How to do with SVG path string? Pin
J. Dunlap20-Jul-04 19:25
J. Dunlap20-Jul-04 19:25 
Questionwindows doesn't distinguish between stanby and hibernate? Pin
vista2720-Jul-04 16:17
vista2720-Jul-04 16:17 
AnswerRe: windows doesn't distinguish between stanby and hibernate? Pin
Nick Parker21-Jul-04 3:34
protectorNick Parker21-Jul-04 3:34 
GeneralString.Input and StreamWriter Pin
j1e1g120-Jul-04 15:09
j1e1g120-Jul-04 15:09 
GeneralRe: String.Input and StreamWriter Pin
Heath Stewart21-Jul-04 4:42
protectorHeath Stewart21-Jul-04 4:42 
QuestionC# Windows Form DataGrid Hyperlink??? Pin
gman4420-Jul-04 14:59
gman4420-Jul-04 14:59 
AnswerRe: C# Windows Form DataGrid Hyperlink??? Pin
Nick Seng20-Jul-04 15:53
Nick Seng20-Jul-04 15:53 
GeneralClick outside of form detection Pin
cdengler20-Jul-04 14:45
cdengler20-Jul-04 14:45 
GeneralRe: Click outside of form detection Pin
J. Dunlap20-Jul-04 19:34
J. Dunlap20-Jul-04 19:34 
GeneralRe: Click outside of form detection Pin
mav.northwind20-Jul-04 20:33
mav.northwind20-Jul-04 20:33 
GeneralRe: Click outside of form detection Pin
cjengler21-Jul-04 1:27
cjengler21-Jul-04 1:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.