Sudoku generator algorithm using a recursive method

I'm trying to create a Sudoku generator that saves the puzzle in a 2D string array. I created a recursive method that returns the puzzle at the end, but as soon as it returns the puzzle it continues with the recursion and so I can never break out of this method. The recursive method code is below: static string[,] RecursiveFill(int digit, int px, int py, string[,] grid) {

使用递归方法的数独生成器算法

我试图创建一个数独生成器,将拼图保存在二维字符串数组中。 我创建了一个递归方法,最后返回这个难题,但只要它返回了这个难题,它就会继续递归,所以我永远不能摆脱这种方法。 递归方法代码如下: static string[,] RecursiveFill(int digit, int px, int py, string[,] grid) { // Create a new test grid string[,] testGrid = new string[9, 9]; // Fill it with the current main gr

How to target both windows phone 8 and 7.5

My app is ready and is too simple, just a panorama and some pivots, nothing specific to windows phone 8. Before sending it I want to make sure that it will work on WP8 and also WP OS 7.1. I saw in the documentations that if we target 7.1 it will work on 8 too, but at the first I have choosed targeting windows 8 and now seems I can't change it in the App properties. How can I know if it w

如何定位Windows Phone 8和7.5

我的应用已准备就绪,太简单了,只是一个全景图和一些支点,没有什么特别的Windows Phone 8。 在发送之前,我想确保它可以在WP8和WP OS 7.1上运行。 我在文档中看到,如果我们的目标是7.1,它也可以工作8,但是在第一个选择的目标是针对Windows 8,现在看来我无法在应用程序属性中更改它。 我怎么知道它是否能正常工作在OS 7.1上? (我没有访问模拟器,只是一个WP8设备) 我怎样才能使它在两个系统上工作? 只是一个

How to organizate custom SQl queres collection

I'm developing an app for Windows Phone with SQlite and have a lot of custom SQL queries. Like string query = "SELECT distinct(destinations.name) as Destinations FROM destinations, flights WHERE destinations.d_ID = flights.d_ID AND flights.Date = #" + date.ToShortDateString() + "#"; then run: var result = (Application.Current as App).db.

如何组织自定义SQl队列收集

我正在用SQlite开发Windows Phone应用程序,并且有很多自定义SQL查询。 喜欢 string query = "SELECT distinct(destinations.name) as Destinations FROM destinations, flights WHERE destinations.d_ID = flights.d_ID AND flights.Date = #" + date.ToShortDateString() + "#"; 然后运行: var result = (Application.Current as App).db.Query(query); 为了使用SQ

windows phone toolkit

I'm developing a windows phone 8.1 silverlight app and I want to provide simple navigation transitions between my pages. I found Windows Phone Toolkit on the Nuget. Unfortunately navigation transitions from the transition service just don't work. What am I doing wrong? (I'm using Caliburn Micro as mvvm framework) Bootstrapper.cs public sealed class Bootstrapper : PhoneBootstra

windows手机工具包

我正在开发一个Windows Phone 8.1 silverlight应用程序,并且我想在我的页面之间提供简单的导航转换。 我在Nuget上找到了Windows Phone Toolkit。 不幸的是,转换服务的导航转换不起作用。 我究竟做错了什么? (我使用Caliburn Micro作为mvvm框架) Bootstrapper.cs public sealed class Bootstrapper : PhoneBootstrapperBase { public PhoneContainer Container { get; set; } public Bootstrapp

What's the difference between dynamic(C# 4) and var?

I had read a ton of articles about that new keyword that will ship with C# v4,but I couldn't make out the difference between a "dynamic" and "var". This article made me think about it,but I still can't see any difference. Is it that you can use "var" only as a local variable,but dynamic as both local and global? I'm sorry for my ignorance,but could

动态(C#4)和var之间有什么区别?

我已经阅读了大量关于将随C#v4发布的新关键字的文章,但我无法弄清楚“动态”和“变种”之间的区别。 这篇文章让我想起了它,但我仍然看不出有什么不同。 难道你可以只使用“var”作为局部变量,但是本地变量和全局变量都是可变的? 对于我的无知,我感到抱歉,但是您能否显示一些没有动态关键字的代码,然后使用动态关键字显示相同的代码? var是静态类型 - 编译器和运行时知道类型 - 它们只是为您节省一些键入...以下是100

Create WPF TextBox that accepts only numbers

This question already has an answer here: How do I get a TextBox to only accept numeric input in WPF? 27 answers Most implementations I have seen so far are using the PreviewTextInput event to implement the correct mask behavior. This one inherits from TextBox and this one uses attached properties. Both use .Net's MaskedTextProvider to provide the correct mask behaviour, but if you jus

创建只接受数字的WPF文本框

这个问题在这里已经有了答案: 如何让TextBox只接受WPF中的数字输入? 27个答案 到目前为止,我所见过的大多数实现都是使用PreviewTextInput事件来实现正确的掩码行为。 这个从TextBox继承,这个使用附加的属性。 两者都使用.Net的MaskedTextProvider提供正确的遮罩行为,但如果您只想要一个简单的“仅限数字”文本框,则不需要此类。 private void txt_TextChanged(object sender, TextChangedEventArgs e) { TextBox

How to make Textbox only accept alphabetic characters

I have a windows forms app with a maskedtextbox control that I want to only accept alphabetic values in. Ideally, this would behave such that pressing any other keys than alphabetic keys would either produce no result or immediately provide the user with feedback about the invalid character. 来自MSDN(这段代码展示了如何处理KeyDown事件来检查输入的字符,在这个例子中它只检查数字输入,你可以修改它

如何使文本框只接受字母字符

我有一个带有maskedtextbox控件的窗体应用程序,我只想接受字母数值。 理想情况下,这会表现为按下除字母键之外的任何其他键都不会产生结果,或者立即向用户提供关于无效字符的反馈。 来自MSDN(这段代码展示了如何处理KeyDown事件来检查输入的字符,在这个例子中它只检查数字输入,你可以修改它以便它可以用于字母输入而不是数字): // Boolean flag used to determine when a character other than a number is entered. pr

How do I prevent a keypress from updating a MaskedTextBox's text?

I need to validate characters entered by the user in a MaskedTextBox . Which characters are valid depends on those already entered. I've tried using IsInputChar and OnKeyPress , but whether I return false in IsInputChar or set e.Handled to true in OnKeyPress, the box's text is still set to the invalid value. How do I prevent a keypress from updating a MaskedTextBox 's text? UPDA

如何防止按键更新MaskedTextBox的文本?

我需要验证用户在MaskedTextBox输入的字符。 哪些字符有效取决于已经输入的字符。 我已经尝试使用IsInputChar和OnKeyPress ,但无论我在返回false IsInputChar或集e.Handled在对的OnKeyPress真,框的文本仍设置为无效值。 如何防止按键更新MaskedTextBox的文本? 更新:MaskedTextBox不是TextBox。 我认为这不应该有所作为,但是从多少人告诉我e.Handled应该起作用,或许它确实有效。 这不会在文本框1中键入字符'x&

Input handling in WinForm

What is the best way to block certain input keys from being used in a TextBox with out blocking special keystrokes such as Ctrl-V/Ctrl-C? For example, only allowing the user to enter a subset of characters or numerics such as A or B or C and nothing else. I would use the keydown-event and use the e.cancel to stop the key if the key is not allowed. If I want to do it on multiple places then I

WinForm中的输入处理

禁止在TextBox中使用某些输入键而无法阻止特殊按键(如Ctrl-V / Ctrl-C)的最佳方法是什么? 例如,只允许用户输入字符或数字的一个子集,例如A或B或C,而没有其他东西。 我会使用keydown事件并使用e.cancel在钥匙不被允许时停止钥匙。 如果我想在多个地方做,那么我会做一个继承文本框的用户控件,然后添加属性AllowedChars或DisallowedChars来为我处理它。 我有几个变体,我经常使用它,有的允许金钱格式化和输入,有的

Object Reference not set to an Instance of an Object

I'm trying to download azure blobs in a Windows Console Application. When I build and debug the application my azure connection string is throwing an exception. This string works fine in my other asp.net app. The offending line is: CloudStorageAccount storageAccount = CloudStorageAccount.Parse(ConfigurationManager.ConnectionStrings["DefaultEndpointsProtocol=https;AccountName=xxxxx;Accoun

你调用的对象是空的

我正尝试在Windows控制台应用程序中下载azure blob。 当我构建和调试应用程序时,我的azure连接字符串抛出异常。 这个字符串在我的其他asp.net应用程序中正常工作。 违规行是: CloudStorageAccount storageAccount = CloudStorageAccount.Parse(ConfigurationManager.ConnectionStrings["DefaultEndpointsProtocol=https;AccountName=xxxxx;AccountKey=xxxxx==;BlobEndpoint=https://xxxxx.blob.core.windows.net/;TableEnd