Tuesday, May 1, 2012
Restore POP3 Mail to the Server
COPY FROM SOURCE: http://www.slipstick.com/outlook/email/restore-pop3-mail-server/
Using IMAP to restore mail to the server
When you email account supports IMAP, you can restore mail to the server in a few simple steps:- Create a second email account in your profile using the IMAP account type.
- You'll now have two accounts in your profile for the same email account, with the IMAP account adding a second *.pst to the profile.
- Make sure you set the POP3 account to leave mail on the server in the account's More Settings. Advanced dialog.
- Drag the messages from the POP3 Inbox to the IMAP folder's Inbox. Tip: You may want to start with about 100 messages at a time and wait a minute or so for the messages to sync up. If it works well, select a larger block of messages to move in the second batch.
- The messages will be synced with the mailbox on the server.
- When finished, remove the IMAP account from the profile. (unless you want to use it instead of POP3.)
Yahoo: use imap-ssl.mail.yahoo.com for the IMAP server name. In Outlook 2007 and 2010 you need to create the account manually.
Hotmail: although Hotmail does not support IMAP, you can use the Outlook Hotmail Connector to upload mail to the server.
Note that both Gmail and Hotmail make it difficult for Outlook to delete mail from the server. If Outlook deleted downloaded email from either account, check your settings in the account online and configure it to archive mail downloaded using POP3.
If your mail server doesn't support IMAP
If your email account does not support IMAP, you can't easily restore mail to the server unless it can POP email from other servers. In this case, you could upload the mail to another server then POP it back to your original email account. If this is not possible and you need online access to the mail you downloaded, consider using Gmail, Hotmail, or Yahoo to store it online for you.If your account can collect mail from POP accounts (like Gmail, Yahoo and Hotmail do), you can upload the mail using IMAP then your account can collect it using POP3. Before using this method, verify your POP3 account can collect mail from the IMAP server - GMail and Hotmail require SSL for POP3 services and many accounts do not use SSL when "popping" accounts.
- Create an account that supports both POP3 and IMAP.
- Use the instructions above to put the mail online.
- Go to your mail account's web access and configure the account to collect POP mail from the new account.
- Once the messages are back online in your mailbox, delete the POP account from the online configuration and the IMAP account from Outlook.
Restoring Exchange Server mail to the server
If this happens with an Exchange server account, set the Exchange account as the default delivery location and drag any mail that does not resync with the Exchange mailbox back to the mailbox.Wednesday, June 29, 2011
state lost Dynamic control in asp.net
you have responsibility to recreate when post back. that 's the reason state and data lost
Monday, June 27, 2011
Handle Dynamic button click event ASP.NET
btnConfig.ID = "Config" + dr("confignum").ToString
btnConfig.Text = dr("configname")
btnConfig.CommandName = "ShowPart"
btnConfig.CommandArgument = dr("confignum")
btnConfig.CssClass = "SingleConfigBtn"
AddHandler btnConfig.Command, AddressOf btnConfig_Click
plcConfigList.Controls.Add(btnConfig)
Sub btnConfig_Click(ByVal send As Object, ByVal e As CommandEventArgs)
showPartList(e.CommandArgument) 'dr("confignum") in this case will be received
End Sub
Thursday, September 16, 2010
Editable sitemap provider and Solve Space querystring bug
Imports System.Data
Imports System.Configuration
Imports System.IO
Imports System.Text.RegularExpressions
Imports System.Web
Imports System.Web.Configuration
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports System.Web.UI.HtmlControls
Imports System.Xml
'''
''' Extends the XmlSiteMapProvider class with edit functionality
''' Requires all siteMapNodes to have unique titles.
'''
Public Class EditableXmlSiteMapProvider
Inherits XmlSiteMapProvider
Public Sub New()
End Sub
Public Shadows Sub AddNode(ByVal parentTitle As String, ByVal title As String, ByVal url As String, ByVal roles As String)
Dim doc As XmlDocument = LoadXmlDoc()
Dim parent As XmlElement = FindNodeByTitle(doc, parentTitle)
Dim newChild As XmlElement = doc.CreateElement("siteMapNode")
newChild.SetAttribute("url", url)
' url must go in lower case to get xpath to work
newChild.SetAttribute("title", title)
' url must go in lower case to get xpath to work
newChild.SetAttribute("roles", roles)
parent.AppendChild(newChild)
SaveXmlDoc(doc)
End Sub
Public Sub UpdateNode(ByVal originalTitle As String, ByVal newParentTitle As String, ByVal title As String, ByVal url As String, ByVal roles As String)
Dim doc As XmlDocument = LoadXmlDoc()
Dim node As XmlElement = FindNodeByTitle(doc, originalTitle)
node.SetAttribute("url", url)
' url must go in lower case to get xpath to work
node.SetAttribute("title", title)
' url must go in lower case to get xpath to work
node.SetAttribute("roles", roles)
' check if the parent has changed
If node.ParentNode.Attributes("title").Value <> newParentTitle Then
node.ParentNode.RemoveChild(node)
' find the new parent
Dim newParent As XmlElement = FindNodeByTitle(doc, newParentTitle)
newParent.AppendChild(node)
End If
SaveXmlDoc(doc)
End Sub
Public Sub DeleteNode(ByVal title As String)
Dim doc As XmlDocument = LoadXmlDoc()
Dim node As XmlElement = FindNodeByTitle(doc, title)
node.ParentNode.RemoveChild(node)
SaveXmlDoc(doc)
End Sub
Private Function LoadXmlDoc() As XmlDocument
Dim doc As New XmlDocument()
doc.Load(HttpContext.Current.Server.MapPath(FilePath))
Return doc
End Function
Private Sub SaveXmlDoc(ByVal doc As XmlDocument)
Dim AbsPath As String = HttpContext.Current.Server.MapPath(FilePath)
Try
doc.Save(AbsPath)
Catch ex As UnauthorizedAccessException
Try
' try to remove 'read-only' attribute on the file.
'WebUtil.RemoveReadOnlyFileAttribute(AbsPath)
doc.Save(AbsPath)
Catch
' throw the original exception
Throw ex
End Try
End Try
MyBase.Clear()
MyBase.BuildSiteMap()
End Sub
Private Function FindNodeByTitle(ByVal doc As XmlDocument, ByVal title As String) As XmlElement
Dim xPath As String = [String].Format("//*[@title='{0}']", title)
Dim node As XmlElement = TryCast(doc.SelectSingleNode(xPath), XmlElement)
If node Is Nothing Then
Throw New Exception("Node not found with title: " & title)
End If
Return node
End Function
'''
''' The built in SiteMapNode.Url property gives a different value to the actual web.sitemap value,
''' it is a mapped value that changes depending on the v.dir of the running web site.
''' This method reads the xml attribute direct from the web.sitemap file.
'''
Public Function GetActualUrl(ByVal title As String) As String
Return Me.FindNodeByTitle(LoadXmlDoc(), title).Attributes("url").Value
End Function
Public Shared ReadOnly Property FilePath() As String
Get
' if anyone gets a nicer method to read the web siteMapFile attribute, please post it. i tried using 'System.Web.Configuration but i couldn't get it working. also, the site breaks when running off VS web server 'because of 'cannot read IIS metabase' errors.
Dim webConfigText As String = File.ReadAllText(HttpContext.Current.Server.MapPath("~/web.config"))
Dim m As Match = Regex.Match(webConfigText, "siteMapFile=""(.*?)""", RegexOptions.IgnoreCase Or RegexOptions.Multiline)
If Not m.Success Then
Return "~/Web.sitemap"
Else
' default value. otherwise we could throw new Exception("web.config does not contain a siteMapFile element");
Return m.Groups(1).Captures(0).Value
End If
End Get
End Property
Public Overrides Function FindSiteMapNode(ByVal context As System.Web.HttpContext) As System.Web.SiteMapNode
Dim node As SiteMapNode = MyBase.FindSiteMapNode(context)
If node Is Nothing Then
If context Is Nothing Then
Return Nothing
End If
Dim queryString As String = CType(context.CurrentHandler, Page).ClientQueryString
Dim pageUrl As String = HttpUtility.UrlDecode(context.Request.Path & "?" & queryString)
node = MyBase.FindSiteMapNode(pageUrl)
End If
Return node
End Function
End Class
Saturday, September 11, 2010
refresh a treeview
changed the "EnableCaching" property of XmlDataSource1 to "false" and the treeview refreshes on button click.
XmlDataSource1.DataBind(); // Rebind datasource to xml file TreeView1.DataBind(); // Rebind tree to datasource
Wednesday, September 1, 2010
How To Fix the: “Validation of viewstate MAC failed” Error (ASP.NET MVC)
Backup from
http://adam.kahtava.com/journal/2009/11/23/how-to-fix-the-validation-of-viewstate-mac-failed-error-aspnet-mvc/
The “Validation of viewstate MAC failed” error only occurred when a page contained an HTML form element that made use of MVC’s AntiForgeryToken. The quick fix was to delete my __RequestVerificationToken
cookie, but the error would rear its ugly head the minute I touched my assemblies. The long term solution was to add a machineKey element to my Web.config file - asking visitors to delete a specific cookies when visiting my site was not a viable option.
How I fixed the “Validation of viewstate MAC failed” error on Shared Hosting:
- I used the
Generator Tool to generate a machine key - I added the machineKey element to my Web.config file
My Web.config now looks similar to this:
Anyhow, I hope this post helps anyone else that’s encountering this error.