Programmatically Read Alerts for Users in Site Collection

SPAlerCollection class can be used to get the Alert Collection for the User.

The below code snippet is used to read all alerts registered for the site collection users.

private
static
शून्य GetAlerts()

{


SPSite currSite = नया
SPSite(“http://उदय”);


SPWeb currWeb = currSite.OpenWeb();


SPUserCollection collUsers = currWeb.Users;


कोशिश

{


foreach (SPUser usr में collUsers)

{


Console.WriteLine(“Alerts for the User : “ + usr.Name);


foreach (SPAlert alrt में usr.Alerts)

{


Console.WriteLine(alrt.Item.Title + ” –> “ + alrt.AlertFrequency);

}

}

}


पकड़

{

}


Console.ReadLine();

}

}



एक उत्तर दें छोड़ दो

आप का उपयोग कर सकते हैं इन HTML टैग

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>