Click here to Skip to main content
15,910,211 members
Home / Discussions / C#
   

C#

 
QuestionHow to upload an email in to VSS through Dotnet coding Pin
mforMurali22-Jan-09 2:43
mforMurali22-Jan-09 2:43 
AnswerRe: How to upload an email in to VSS through Dotnet coding Pin
Wendelius22-Jan-09 3:17
mentorWendelius22-Jan-09 3:17 
QuestionHow to count a string for \ character? Pin
Matjaz-xyz22-Jan-09 2:08
Matjaz-xyz22-Jan-09 2:08 
AnswerRe: How to count a string for \ character? Pin
Rob Philpott22-Jan-09 2:23
Rob Philpott22-Jan-09 2:23 
AnswerRe: How to count a string for \ character? Pin
Matjaz-xyz22-Jan-09 2:36
Matjaz-xyz22-Jan-09 2:36 
GeneralRe: How to count a string for \ character? Pin
J4amieC22-Jan-09 2:41
J4amieC22-Jan-09 2:41 
GeneralRe: How to count a string for \ character? Pin
Matjaz-xyz22-Jan-09 3:48
Matjaz-xyz22-Jan-09 3:48 
GeneralRe: How to count a string for \ character? Pin
Ben Fair22-Jan-09 4:31
Ben Fair22-Jan-09 4:31 
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)

AnswerRe: How to count a string for \ character? Pin
Jon Rista22-Jan-09 4:58
Jon Rista22-Jan-09 4:58 
AnswerRe: How to count a string for \ character? [modified] Pin
Luc Pattyn22-Jan-09 9:26
sitebuilderLuc Pattyn22-Jan-09 9:26 
Questionhow to make a value in an excel cell read only using c#? Pin
abhiram_nayan22-Jan-09 1:54
abhiram_nayan22-Jan-09 1:54 
AnswerRe: how to make a value in an excel cell read only using c#? Pin
Dave Kreskowiak22-Jan-09 7:06
mveDave Kreskowiak22-Jan-09 7:06 
GeneralRe: how to make a value in an excel cell read only using c#? Pin
abhiram_nayan22-Jan-09 19:17
abhiram_nayan22-Jan-09 19:17 
GeneralRe: how to make a value in an excel cell read only using c#? Pin
Dave Kreskowiak23-Jan-09 2:26
mveDave Kreskowiak23-Jan-09 2:26 
GeneralRe: how to make a value in an excel cell read only using c#? Pin
abhiram_nayan23-Jan-09 2:47
abhiram_nayan23-Jan-09 2:47 
GeneralRe: how to make a value in an excel cell read only using c#? Pin
Dave Kreskowiak23-Jan-09 13:45
mveDave Kreskowiak23-Jan-09 13:45 
QuestionNeed help to implement PROGRAMABLE KEYBORD WITH CREADIT CARD Pin
sharetuto22-Jan-09 1:46
sharetuto22-Jan-09 1:46 
AnswerRe: Need help to implement PROGRAMABLE KEYBORD WITH CREADIT CARD Pin
PC Player22-Jan-09 6:31
PC Player22-Jan-09 6:31 
QuestionNeed help to implement PROGRAMABLE KEYBORD WITH CREADIT CARD Pin
sharetuto22-Jan-09 1:46
sharetuto22-Jan-09 1:46 
AnswerRe: Need help to implement PROGRAMABLE KEYBORD WITH CREADIT CARD Pin
DaveyM6922-Jan-09 1:58
professionalDaveyM6922-Jan-09 1:58 
GeneralRe: Need help to implement PROGRAMABLE KEYBORD WITH CREADIT CARD Pin
EliottA22-Jan-09 3:12
EliottA22-Jan-09 3:12 
GeneralRe: Need help to implement PROGRAMABLE KEYBORD WITH CREADIT CARD Pin
Dan Neely22-Jan-09 3:46
Dan Neely22-Jan-09 3:46 
GeneralRe: Need help to implement PROGRAMABLE KEYBORD WITH CREADIT CARD Pin
EliottA22-Jan-09 5:02
EliottA22-Jan-09 5:02 
GeneralRe: Need help to implement PROGRAMABLE KEYBORD WITH CREADIT CARD Pin
Dan Neely22-Jan-09 5:28
Dan Neely22-Jan-09 5:28 
GeneralRe: Need help to implement PROGRAMABLE KEYBORD WITH CREADIT CARD Pin
EliottA22-Jan-09 5:29
EliottA22-Jan-09 5:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.