Thank you
sri_3464 0
Posts
-
Regular expression to check special character -
Regular expression to check special characterI need to check whether password has at least 6 characters with at least 1 letter and one special character. I am checking the condition !Regex.IsMatch(strPassword,"(?!^[0-9]*$)(?!^[a-zA-Z]*$)^([a-zA-Z0-9]{6,24})$"). But it doesnot allow special character. I need to change the expression to check if there is at least one special character. Please help me out.
-
Regular expression to check special characterI need to check whether password has at least 6 characters with at least 1 letter and one special character. I am checking the condition !Regex.IsMatch(strPassword,"(?!^[0-9]*$)(?!^[a-zA-Z]*$)^([a-zA-Z0-9]{6,24})$"). But it doesnot allow special character. I need to change the expression to check if there is at least one special character. Please help me out.
-
Difference between where<>() and where() in linq? [modified]i have a basic question in linq. Lets say i have a list of student collection List<Student> lstStudents = new List<Student>(); Now when i use the where method, i can either specify List<Student> lstFilteredStudents = lstStudents.where<Student>(...); or i can specify List<Student> lstFilteredStudents = lstStudents.where(...); Now my question is wat is the difference between calling these two methods internally?
modified on Wednesday, March 3, 2010 6:45 AM
-
How to set a property in a collection based on the join?i have two collections defined below
List lstScienceStudents = GetScienceStudentCollection();
List lstMathsStudents = GetMathsStudentCollection();Now both the classes ScienceStudents and MathsStudents have a common id Student_Id. I need to set the boolean property IsMathStudent in lstScienceStudents to true by joining the two collection. To be more clear here is the code
for (int i = 0; i < lstScienceStudents .Count; i++)
{
for (int j = 0; j < lstMathsStudents.Count; j++)
{
if (lstScienceStudents[i].Student_Id == lstMathsStudents[j].Student_Id)
lstScienceStudents[i].IsMathStudent = true;
}
}I know i can get the collection of MathsStudents in ScienceStudent collection using join in linq. But i need to set the flag to true in the lstScienceStudent collection list. How can i do it?
-
Add months and set the last day of the month in one stepThanks Luc!! Why didnt it strike in my mind... :)
-
Add months and set the last day of the month in one stepI want to add months and set the day as last day of that added month. I know i can do in the following way,
DateTime ldtManipulatedDate = new DateTime(1998,lintMonths,1).AddMonths(lintAddMonths); ldtManipulatedDate = new DateTime(ldtManipulatedDate.Year ,ldtManipulatedDate.Months,DateTime.DaysInMonth( ldtManipulatedDate.Year,ldtManipulatedDate.Months));
The above code will first add months and then set the day as last day of that added month. But i want this in one step as i am instantiating two times. Please let me know how can i do it? -
"The path is not of a legal form." on trying to start the service created in c#Thanks Keefb! I got the mistake i have done... Also as you said i should have started with as a console application.
-
"The path is not of a legal form." on trying to start the service created in c#Service1.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Configuration;namespace FileTransfer
{
public partial class Service1 : ServiceBase
{
public Service1()
{
InitializeComponent();
}protected override void OnStart(string\[\] args) { try { FileTransferWatcher.Created += new System.IO.FileSystemEventHandler(FileTransferWatcher\_Created); } catch (Exception ex) { EventLog.WriteEntry("Message : " + ex.Message); } } void FileTransferWatcher\_Created(object sender, System.IO.FileSystemEventArgs e) { System.IO.File.Copy(e.FullPath, @"D:\\"); } protected override void OnStop() { } }
}
Service1.Designer.cs
namespace FileTransfer
{
partial class Service1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components;/// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Component Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.FileTransferWatcher = new System.IO.FileSystemWatcher(); // // FileTransferWatcher // this.FileTransferWatcher.EnableRaisingEvents = true; **this.FileTransferWatcher.Path = "D:\\\\Test\\\\";** // // Service1 // this.ServiceName = "FileTransfer"; } #endregion private System.IO.FileSystemWatcher FileTra
-
"The path is not of a legal form." on trying to start the service created in c#Hi, I tried created a windows service which does a file transfer from the folder its watching whenever a new file being created in it.I am getting an exception saying "The path is not of a legal form." on trying to start the service. An the path the exception refering to is the path that i set to the FileSystemWatch. Path property. I dont understand why it happens. The path is "D:\Test". The folder has all the permission to access. Can anyone help me out.
-
Insertion Problem into DatabaseTry inserting the data inside the transaction and commit the transaction in .net code
modified on Wednesday, December 30, 2009 12:48 PM
-
Customize web deployment setupThanks Abhijit. But then, in my target machine the Virtual directory and Application pool are already configured and i just have to create the msi package and install it in the target machine without any wizard for getting the inputs from the user during the installation process.
-
ASP.NET SOAP Server/Client with Complex TypesThe Organization present in the object info is null. Try this VerifyInsurance.RequestorInformation info = new VerifyInsurance.RequestorInformation(); info.Organization = new Organization(); info.Organization.Name = "Test Org"; VerifyInsurance verify = new VerifyInsurance(); verify.CoverageRequest(info); This should work.
-
Best way to deploy a site to several servers at onceWe have done the same requirement through CruiseControl .Net. You can google for Cruise COntrol to implement
-
Customize web deployment setupMy requirement is to create a msi package for a web application and deploy it to the target machine which already has the virtual directory and app pool configured. Now evertime when i try to install the web application thru the msi package, the setup should not ask for any inputs from the user(meaning no UI interface should be involved) and the msi should be successfully installed. Can anyone please help me out?? I have googled a lot. Not finding a proper solution