This question already has an answer here:
I've seen a few posts discussing "what have you tried" comments here, but I thought I'd throw a suggestion out there after recently noticing quite a few of these comments on SO.
If the user has less than
x reputation points, posts a question with a programming language tag (e.g.
C#), and hasn't used the
code tags in their question, then a pop up or alternative page could be shown explicitly asking the user what they have tried. They can leave this blank, but it ensures that they have purposely avoided showing code and, therefore, have not misunderstood that SO isn't for writing your code. This also helps avoid questions being closed when the user is genuinely unaware that this isn't considered a good question.
I understand not every question will be suited to this, but it might be an idea for users posting their first question or have a rep level below 15, for example.