Click here to Skip to main content
15,903,362 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: How to get DPI Scaling number within .NET Framework (SOLVED) Pin
fjparisIII21-Jul-09 11:16
fjparisIII21-Jul-09 11:16 
QuestionUnderstanding HandleRef Pin
stax7620-Jul-09 4:29
stax7620-Jul-09 4:29 
AnswerRe: Understanding HandleRef Pin
Eddy Vluggen20-Jul-09 6:25
professionalEddy Vluggen20-Jul-09 6:25 
GeneralRe: Understanding HandleRef Pin
stax7620-Jul-09 6:47
stax7620-Jul-09 6:47 
GeneralRe: Understanding HandleRef Pin
Eddy Vluggen20-Jul-09 9:18
professionalEddy Vluggen20-Jul-09 9:18 
GeneralRe: Understanding HandleRef Pin
stax7620-Jul-09 9:35
stax7620-Jul-09 9:35 
GeneralRe: Understanding HandleRef Pin
Eddy Vluggen20-Jul-09 10:16
professionalEddy Vluggen20-Jul-09 10:16 
QuestionThe remote server returned an error: (403) Forbidden." Pin
nkmkrishna20-Jul-09 2:45
nkmkrishna20-Jul-09 2:45 
Hi to all,
I am using Exchange server 2003 & Visual studio 2008
My project is read Unmails from mail server through Interop.MSXML2.dll and pass the mail values like (from,to,body,attachments) to my another application.
My mail server is my Organization server.
Now I read my Unread mails from my server.It shows the following Error Message.

"The remote server returned an error: (403) Forbidden."

Another time I re-run the same application it runs successfully.
now i change the mailserver mail id,First time it shows the the above message. & next time its works fine...


my Sample code:::

Sub XMLEMailWrite()

Dim loRequest As System.Net.HttpWebRequest
Dim loResponse As System.Net.HttpWebResponse
Dim loCredentials As System.Net.CredentialCache
Dim strLsrooturi, strLsquery As String
Dim laBytes() As Byte
Dim loRequestStream As System.IO.Stream
Dim loResponseStream As System.IO.Stream
Dim loXmlDoc As System.Xml.XmlDocument
Dim strpath As String = Path.GetFullPath(strXMLpath)
Dim fiPath As FileInfo = New FileInfo(strpath)
Try
If (fiPath.Exists) Then
File.Delete(strpath)
End If
strLsrooturi = strPathmail & strReadfolder
strLsquery = "<?xml version=""1.0""?>" & "<D:searchrequest xmlnsBig Grin | :-D = ""DAV:"" xmlns:m=""urn:schemas:httpmail:"">" & "<D:sql>SELECT ""urn:schemas:httpmail:hasattachment"", ""DAV:displayname"", ""urn:schemas:httpmail:from"", ""urn:schemas:httpmail:subject"",""urn:schemas:httpmail:textdescription"",""DAV:id"" FROM """ & strLsrooturi & """" & " WHERE ""urn:schemas:httpmail:read"" = false" & "</D:sql></D:searchrequest>"
loCredentials = New System.Net.CredentialCache
loCredentials.Add(New System.Uri(strLsrooturi), "NTLM", New System.Net.NetworkCredential(strUsername, strPassword, strDomain))
loRequest = CType(System.Net.WebRequest.Create(strLsrooturi), System.Net.HttpWebRequest)
loRequest.Credentials = loCredentials
loRequest.Method = "SEARCH"
laBytes = System.Text.Encoding.UTF8.GetBytes(strLsquery)
loRequest.ContentLength = laBytes.Length
loRequestStream = loRequest.GetRequestStream
loRequestStream.Write(laBytes, 0, laBytes.Length)
loRequestStream.Close()
loRequest.ContentType = "text/xml"
loRequest.Headers.Add("Translate", "F")
loResponse = CType(loRequest.GetResponse, System.Net.HttpWebResponse)
loResponseStream = loResponse.GetResponseStream
loXmlDoc = New System.Xml.XmlDocument
loXmlDoc.Load(loResponseStream)
loXmlDoc.Save(Path.GetFullPath(strXMLpath))
loResponseStream.Close()
Catch ex As Exception
Err.ErrorLog(strErrorfile, "XMLEMailWrite()", ex.Message)
End Try
End Sub

What is that problem & how to rectify that one?????

Pls help me...


thanks,
nkmkrishna
AnswerRe: The remote server returned an error: (403) Forbidden." Pin
Adam R Harris21-Jul-09 10:05
Adam R Harris21-Jul-09 10:05 
AnswerRe: The remote server returned an error: (403) Forbidden." Pin
veerasekar vallambar15-Jun-10 4:49
veerasekar vallambar15-Jun-10 4:49 
Question"........make sure u've not released resources before trying to use it"???? Pin
ChiSmile20-Jul-09 0:46
ChiSmile20-Jul-09 0:46 
AnswerRe: "........make sure u've not released resources before trying to use it"???? Pin
Gideon Engelberth20-Jul-09 3:25
Gideon Engelberth20-Jul-09 3:25 
GeneralRe: "........make sure u've not released resources before trying to use it"???? Pin
ChiSmile20-Jul-09 5:50
ChiSmile20-Jul-09 5:50 
GeneralRe: "........make sure u've not released resources before trying to use it"???? Pin
Gideon Engelberth20-Jul-09 12:00
Gideon Engelberth20-Jul-09 12:00 
QuestionRetrieve node texts from treenode Pin
vidhyaravichandar19-Jul-09 22:16
vidhyaravichandar19-Jul-09 22:16 
AnswerRe: Retrieve node texts from treenode Pin
Lee Humphries20-Jul-09 11:39
professionalLee Humphries20-Jul-09 11:39 
GeneralRe: Retrieve node texts from treenode Pin
vidhyaravichandar20-Jul-09 15:53
vidhyaravichandar20-Jul-09 15:53 
QuestionHow to include xml Pin
ksss_maheshece19-Jul-09 21:15
ksss_maheshece19-Jul-09 21:15 
QuestionAsync Sockets Pin
Lee Humphries19-Jul-09 20:38
professionalLee Humphries19-Jul-09 20:38 
AnswerRe: Async Sockets Pin
Nicholas Butler19-Jul-09 22:13
sitebuilderNicholas Butler19-Jul-09 22:13 
GeneralRe: Async Sockets Pin
Lee Humphries20-Jul-09 11:34
professionalLee Humphries20-Jul-09 11:34 
GeneralRe: Async Sockets - the answer Pin
Lee Humphries20-Jul-09 19:11
professionalLee Humphries20-Jul-09 19:11 
Questiontest Pin
chandni patel18-Jul-09 23:35
chandni patel18-Jul-09 23:35 
AnswerRe: test Pin
Abhijit Jana19-Jul-09 0:14
professionalAbhijit Jana19-Jul-09 0:14 
AnswerResult Pin
leckey19-Jul-09 18:42
leckey19-Jul-09 18:42 

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.