Regex regex = new Regex(@"<body[^>]*>(.*?)</body>", RegexOptions.IgnoreCase | RegexOptions.Singleline); Match match = regex.Match(text); if (match.Success) { body = match.Groups[1].Value; }
REGEX : content of a body tag in html
LINQ : groups within groups
var groupsByType = (from SPListItem n in notifications group n by n[C.DPRequestsQueueNotifications.NotificationType] into groupByType let groupsBySubject = from n in groupByType group n by n[C.DPRequestsQueueNotifications.Title] into groupBySubject select groupBySubject select groupsBySubject).ToList(); foreach (var groupByType in groupsByType) { foreach (var groupBySubject in groupByType) { foreach (SPListItem item in groupBySubject) { // TODO } } }
REFLECTION : how to set private TextBox.Text property
string fieldName = "m_dateTextBox"; Type type = someObject.GetType(); FieldInfo fieldInfo = type.GetField(fieldName, BindingFlags.NonPublic | BindingFlags.Instance); TextBox textBox = (TextBox)fieldInfo.GetValue(someObject); textBox.Text = DateTime.Now.ToString("d");
Přihlásit se k odběru:
Příspěvky (Atom)