Question: I have windows application in c#

with a form with 7 text box that i want to check (and more controls in the form)

i want to check all this 7 text box , that the user enter in data , and this is a number

all this text box **start** with the **same name**

How can i do it ?

thanks.

i start to write something like that but i am stack

```
     foreach (TextBox box in this.Controls.OfType<TextBox>()
.Where(tb => tb.Text.StartsWith('tbwin')))

```

Answer: 
I wouldn't see the singleton pattern as being a useful solution to the problem you're trying to solve. It's really designed as a technique to control access to a single/finite resource, which isn't meaningfully the case from what I can tell.

For example, is there any reason why you wouldn't permit a user to carry out two network related activities at the same time?

Incidentally, out of interest have you looked at Cocoa classes such as [NSURLConnection](http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSURLConnection_Class/Reference/Reference.html)? I'm not sure you'd need a lower level class to manage the server communications as you're envisaging - this class might suffice. (Had to tell without knowing more about what you're trying to achieve.)
I would use the Service Locator pattern to obtain each of the services needed in your application. There are a couple different ways to create the service locator. I prefer configuration at initialization over configuration during runtime.

<http://en.wikipedia.org/wiki/Service_locator_pattern>