|
I suppose, one way could be that you save the email to a file (for example to an eml-file if it's from Outlook), and after that you add the file to Source Safe. This would require using interop against Outlook and Source Safe.
|
|
|
|
|
|
Wild guess - something to do with Unicode/CodePage? If you open the file up using the binary editor is every other character zero?
Regards,
Rob Philpott.
|
|
|
|
|
Ok. Dont know why my solution didnt work... but i've modified it a bit - a bit of a hax :P
If i putted '\\' char to search... it found something. What did it found - i dont know... but it wasn't right.
So, i've tried this - created a new textbox and enter one character inside - the '\'. And with this IT WORKED.
So, here is the new code, that works if anyone's intrested.
PS: thanks for your reply Rob.
public void DoYourThingBaby()
{
string pot = @Application.StartupPath + @"\" + lstFILES.SelectedItem;
StreamReader sr = new StreamReader(pot);
string tempF = sr.ReadToEnd();
sr.Close();
char[] tempC = tempF.ToCharArray();
int stevc=0;
foreach(char chr in tempC)
if(chr==Convert.ToChar(textBox1.Text))
stevc++;
}
Regards,
Matjaž
|
|
|
|
|
Can I ask what the point in the final 3 lines are below?
Matjaž Grahek wrote: string pot = @Application.StartupPath + @"\" + lstFILES.SelectedItem;
StreamReader sr = new StreamReader(pot);
string tempF = sr.ReadToEnd();
sr.Close();
Seems a bit of a WTF to me.
|
|
|
|
|
Bah... it IS WTF but its easier for my understanding... dont even bother with this.
Programming is cool because of this - you have soooooo many different ways to make a program work.
Regards,
Matjaž
|
|
|
|
|
Just Split() the string on the char you want to count, the count will be the number of resulting array elements minus 1 (have to escape the backslash as '\\' ). Most likely your results were thrown off by the escaping of special characters in the text (CRLF becomes \r\n , TAB becomes \t , etc.) and perhaps it brought them over into the char[] in that manner. Either way, this will do the trick:
public void DoYourThingBaby()
{
string pot = @Application.StartupPath + @"\" + lstFILES.SelectedItem;
if(!System.IO.File.Exists(pot))
return;
int count = System.IO.File.ReadAllText(pot).Split('\\').Length - 1
}
Keep It Simple Stupid! (KISS)
|
|
|
|
|
You can use LINQ to accomplish the same thing in a more expressive manner:
int bkslashCount = 0;
string pot = Path.Combine(Application.StartupPath, lstFILES.SelectedItem);
if (File.Exists(pot))
{
string data = File.ReadAllText(pot);
bkslashCount = data.ToCharArray().Where(c => c == '/').Count();
}
|
|
|
|
|
Hi,
probably a lot cheaper is count=str.Length-str.Replace("\\","").Length;
|
|
|
|
|
hey ppl, am developing an excel com add-in using c# and displaying certain data over excel sheets. How can i make a cell or a range of cells or some arbitrary cells "read-only" using c# code?!
|
|
|
|
|
There is no "ReadOnly" attribute for cells or worksheets. You have to do this the exact same way you would if youwere to do it in Excel itself. Turn on the "Locked" property of the cell, then call the method to protect the worksheet to turn on all the protection. I don't the exact code or classes/methods to use since I don't normally do Office interop.
|
|
|
|
|
Erm, i know this process, but was not finding a way to protect my active sheet. It would be gr8 to get the exact code to do so.
Thanks.
|
|
|
|
|
A little Googling found this[^].
|
|
|
|
|
I did try it before but, I want the remaining cells to remain unlocked!!where as this is protecting my entire sheet. I want for example, only my active cell to be made readonly. what has to be done then?
|
|
|
|
|
All cells, by default, have Protection turned on. You have to specifically unprotect the cells you went to remain active when the sheet protection is turned on.
|
|
|
|
|
I am implementing programmable keyboard with credit card facilities.
I want to help to implement the credit card recognition part and how to work with bank with the keyboard that i currently implementing.
If you know how do i start it. Please help me.
Source code or by providing references.
My email gayanfit6@gmail.com
Thank million.
with regards.
Gayan.
|
|
|
|
|
Hi,
I don't know which Programable keybord are you using. Anyway you may need to contact Third Party service to processes any Credit Card/Debit Card. Normally Bank will not allow directly to process any Credit Card/Debit card to the End User (Like you). Hope it may help.
Thanks
Ali Zishan
London
|
|
|
|
|
I am implementing programmable keyboard with credit card facilities.
I want to help to implement the credit card recognition part and how to work with bank with the keyboard that i currently implementing.
If you know how do i start it. Please help me.
Source code or by providing references.
My email fun2021@gmail.com
Thank million.
with regards.
Gayan.
|
|
|
|
|
I would imagine you need to talk to the merchant account providers, and card reader hardware vendors.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
do credit card companies hire just anyone these days? No clue where to even start?
I'd imagine that credit card companies have strict regulations as per project secrecy and whatnot, if you indeed have a job with them, you shouldn't post about it on public forums, nor any part of the coding.
Don't they do their work in java anyways?
Here is some nice articles[^] about credit cards, validation and verification through our very own CP.
|
|
|
|
|
he's probably not working for a CC company directly. Some banks have came up with the brillant idea of using onscreen keyboards for password input to try and beat keystroke loggers (which promptly updated themselves to read the clicks of the virtual keyboard ). My guess would be that some PHB's dediced it would be a good idea to use the same clubuttic idea for CC number input.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
Stupidity over security. You've got to be shitting me. Why not just remove spyware... sometimes, ideas like this make my head hurt.
|
|
|
|
|
PHB bank can't make Joe Moron install antivirus, etc. software on his own computer.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
PHB bank shouldn't employ Joe Moron.
|
|
|
|
|
Joe Moron isn't a PHBbank employee, he's a customer. Any general purpose business that only dealt with clueful people wouldn't be able maintain a large enough customer base to survive.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|