|
i have encoded a string to ascii code like this
string s="123456*123456";<br />
byte[] sByte=Encoding.ASCII.GetBytes(s);
and i need to decode the sByte back to s string... i don't know how
need help please
|
|
|
|
|
string s = Encoding.ASCII.GetString(sByte);
|
|
|
|
|
|
Dear All,
PLease let me know how to check whether a specified character exists in a text or ? I am validating Password and I want to make sure that the password must contain atleast one numeric(0 to 9) , one special character and one uppercase letter.
thanx in advance
|
|
|
|
|
<br />
public static bool CheckForE(string s) {<br />
return s.Contains("e");<br />
}
Standards are great! Everybody should have one!
|
|
|
|
|
While
abc.Contains("0");
...
abc.Contains("%");
May work it will be too slow.
if(abc.Length > MIN_LENGTH){
char c;
for(int i=0;i<abc.length;i++){
c = abc[i];
if(!numberFound)
numberFound = Char.IsNumber(c);
if(!specialFound)
specialFound = Char.IsSymbol(c);
if(!upperFound)
upperFound = Char.IsUpper(c);
if(!lowerFound)
lowerFound = Char.IsLower(c);
if(numberFound && specialFound && upperFound && lowerFound){
valid = true;
break;
}
}
}
File Not Found
|
|
|
|
|
use substring to pull out each character in turn and if the character is of a type set a flag so you know you've found it. at the end all flags should be set and you're ready to go.
BTW you should also test for lowercase as you are assuming that Upper case is different from the norm.
Russ
-- modified at 10:01 Friday 30th March, 2007
|
|
|
|
|
Hi,
String.IndexOfAny(char[]) can check for the presence of any of a collection of chars.
and String.ToCharArray() may be useful too.
|
|
|
|
|
Hi evry1...this is my first post so excuse if there are any errors...
I want to create a small application which will enable me to save and create a file from the same dialog. for this i want to inherit the windows open or New file dialog and add radio buttons to indicate whether the file is to be created or opened.
Can u guys tell me how to carry out the task...i mean how to inherit the windows dialog and do changes to it...
P.S Im using Visual Studio 2005 and C#.net 2.0
|
|
|
|
|
I don't think you can inherit from it. You CAN write code that adds to the control tho.
This[^] is a good place to start ( first item )
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hello!
I have a problem. I want to create an Excel document programmatically in C# and then return it as a stream. This works fine if I save the document to disk first and then copy it into a filestream. But I want to copy it directly without saving it to disk first. Anyone who knows how to do this?
Thanks..
|
|
|
|
|
i have to make multilingual pages in asp.net.i made one pg in english and then copied its resource file to make another resource file for urdu.in the Initilize culture method it gives me this exception:
System.NotSupportedException: Culture 'ur' is a neutral culture. It cannot be used in formatting and parsing and therefore cannot be set as the thread's current culture
Any suggestions / ideas would be greatly appreciated.
|
|
|
|
|
I'm not familiar to ASP.NET but i guess the problem is similar to a Standard WindowsApplication.
The cultureInfo is devided in three groups: invariant languages, neutral languages and specific languages.
Invariant languages and neutral languages can not be used as a language in a thread. You always need to define a specific language (in your case it should be "ur-PK").
The three groups of languages are build up like a tree.
invariant--- neutral A -- specific AA
| |-------- specific AB
|
|------ neutral B -- specific BA
|-------- specific BB
In case that the system can not find a "specific AA"-ResX it will fallback to a "neutral A"-ResX. If it doesn't find a "neutral A"-ResX it will fallback to the "invariant"-ResX. The specific languages are like dialects.
Localization is quite a complex theme and should be handled carfully. You can find a lot of articles in the internet and the MSDN. Take your time to read a few of them. --good luck--
greets snowprog
|
|
|
|
|
hi,
i am controls like combobox,date and time picker and radiobuttons..
Now i am saving the values of all controls in the form, through XML file.
and loading those values whenevr that form loads...
whenever I change the values and clicks on k the old values will be overidden..
I want old values and new values too...
Help me pls
With regards
prasad
|
|
|
|
|
If you want to keep a history, you need to set up your XML so that when you save never values, you append the XML instead of overwriting it
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
HI,
can u say how can I append the XMl File..
pls help me
With Regards
prasad
|
|
|
|
|
can any one tell me that how diaplay the files from a selected folder to excel sheet from a list view at run time, i want to count the number of file's of that folder by displaying those fils with there parent folder name in excel sheet, in come object's i have "microsoft excell 9.0" i m getting the excell sheet at run time but i can't diaplay the file's of the selected folder in that i m getting an error message,..... so if anu one can help me in this case he is most welcomed and thanx to the person in advance...
sarvesh rai <sarveshrai_86@hotmail.com>
|
|
|
|
|
Hi all,
i am making a windows based application, here i am using a DataGridView(of C#2.0)
here i wanna add a label control in my GridView,
i have to fill a colomn say(LabeledData) with a Label Control For each row,
hope u got me.
please help me solving this problem
bye byes,
thnx in advance
prashanth
|
|
|
|
|
Hello...
I need a help.
I have a double value like this
39171.5338997917
I want to change it to string but with a format like this
3.91715338997917e+004
What kind of format should I use to format the double value ?
Thanks...
|
|
|
|
|
You could do it like this:
<br />
decimal myValue = 39171.5338997917;<br />
text myRequestedTexy = Convert.ToDouble(myValue).ToString("E");<br />
Hope it helps.
protected internal static readonly ... and I wish the list could continue ...
|
|
|
|
|
Hi!
i am working on a hospital data base. i have two tables Administration and knowlege base.
in Administration i have columns ID, NumberOfDoctors etc, and in KnowlegeBase i have some similar columns but ofcourse differnet data.
Administration
ID Date HospitalName NumberOfDoctors ........
71 4/6/2007 Children Hospital 378 ....
153 4/19/2007 MH 600
207 4/20/2007 Our Hospital 100
227 4/15/2007 My Hospital 30
313 4/11/2007 Hospita 150
576 4/17/2007 Health Ways 80
KnowlegeBase
ID NumberOfDoctors NumberOfBeds AvgPatientPerDoc .........
1 378 1500 20 ...........
I now want to compare and iterate through the rows of Administration.NumberOfDoctors with KnowlegeBase.NumberOfDoctors.. and i dont know how to do it.
Any help.. any ideas.. anythingg....??
(using sql server2005 and c#)
|
|
|
|
|
Hi,
I have a combobox and when i remove all the elements from it, the last element name stays in the area where we can type.
i have tried to force the removal with this code:
<br />
cbProperties.SelectedItem = null;<br />
cbProperties.SelectedValue = "";<br />
cbProperties.SelectedText = "";<br />
But its not working.
Any tips?
Thx,
Nuno
|
|
|
|
|
|
How about setting the DropDownStyle property into DropDownList. That is if you don't need to type anything to the combo box.
Amir Syafrudin
|
|
|
|
|
Perfect!
Thank you very much!
Nuno
|
|
|
|