And there are no "simple" answers to simulating pool, snooker, or even billiards. Learning to plan the real game properly at a good quality can absorb huge amounts of your life, because tiny differences cause such massive changes: professional snooker players take years to get to that level, and have to practice 5 ~ 6 hours a day, 6 days a week to maintain, let alone improve their skills.
Simulating that? Not a trivial subject in any way, shape, or form - so there are no "no complex answers" other than "go to Google, and it will serve up some of the complicated ones".
Seriously, this isn't a task for a beginner - I wouldn't want to try it on my own and I've been coding for 30+ years! I'd need a team of developers, designers, and some professionals on standby to get any reasonable results in a workable time frame of 2 ~ 3 years. Even then, it probably wouldn't be ready for public release for another year or two after that. It's a big job!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
That's like saying, "Where can I get a simple diagram of a Formula 1 engine, I have just learned how to assemble a 3-speed gear on my bike". And the issue really is not about C#, it is about the physics of ball trajectories on a pool/snooker table. Spend more (much more) time on some simple projects and learn as many .NET classes as possible first.
Hi, thanks for your reply. I have updated my pattern by eliminating the back slash in front of the colon and semicolon as you have suggested. However, it still does not work. Below is the updated pattern
publicasync Task<List<ActiveDirectoryUser>> ImportUsersAsync(string basePath)
returnawait Task.Run(() =>
List<ActiveDirectoryUser> users = new List<ActiveDirectoryUser>();
var rootEntry = new DirectoryEntry(basePath);
var searcher = new DirectorySearcher(rootEntry);
SearchResultCollection results = searcher.FindAll();
if (results != null)
foreach (SearchResult result in results)
ActiveDirectoryUser user = new ActiveDirectoryUser();
user.DisplayName = (string)result.Properties["displayname"];
user.LoginName = (string)result.Properties["samaccountname"];
foreach (var prop in result.Properties)
DictionaryEntry de = (DictionaryEntry)prop;
ResultPropertyValueCollection rpvc = (ResultPropertyValueCollection)de.Value;
now, when i run it:
ActiveDirectoryHelper adHelper = new ActiveDirectoryHelper();
var users = adHelper.ImportUsersAsync(basePath); // This is asyncvar user = adHelper.GetUserInfo(serverName, userName);
How can I know when the async method finished?
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
Then you can call it like this (very simple Windows Forms example):
privateasyncvoid button1_Click(object sender, EventArgs e)
// The await just says "Put a bookmark here and return from the method until the Task returns". // In this simple Windows Forms example, the code will go back to processing the message pump, // keeping the UI alive.var users = await GetUsersAsync();
// When the Task returns, the code will resume here and show the list that was returned.foreach (string user in users)
Is this production quality code? NO! It's meant to be a simple example demonstrating Task/Async/Await. It doesn't handle exceptions and doesn't make sure the Click handler doesn't get called again while the first Task is still running.
System.ItDidntWorkException: Something didn't work as expected.