|
From the top of the site: Code Project - For those that code.
You have not clearly identified what you are looking for or what you have already tried.
People may be willing to help you with solve a problem you have with your code, but they will not simply give you the code.
And, it you aren't looking for code or help with code, then what are you looking for?
|
|
|
|
|
you're right! I was literally what I want
|
|
|
|
|
When Asp.net Development server start and to get the data on ftp server and store the database on every 5 minutes, It will not disturb my web pages.
please help me how to developed this kind of website?
Best Regards,
Muruga
|
|
|
|
|
|
Please provide me the C# code to read and write Node "HostName" of the below Xml File.
You can just save the below content into the .xml file.
<storage version="2">
<settings>
<hostname>Pabuild12
<portnumber>55051
<location>shared
|
|
|
|
|
You seem to be under the impression we are just waiting here to do your work for you.
Please read the guidelines at the top of the page, it may give you a clue.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
As suggested, please read this[^] first.
Tell us what you did and what the exact problem is, then we can give you tips or hints for a solution.
No one here will never ever write a solution for you. If you want that go here[^].
|
|
|
|
|
Friends, i need a code to make the function queue, deletions at the beginning and at the end inclisões. This code works correctly as Stack. I need it to work as a queue. Please
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
public class Pilha
{
private int[] valores;
private int topo;
public Pilha(int n)
{
if (n > 0)
{
valores = new int[n];
topo = -1;
}
}
public int Push(int valor)
{
if (topo < valores.Length - 1)
{
topo++;
valores[topo] = valor;
return 0;
}
return -1;
}
public int Pop()
{
if (topo >= 0)
{
int valor = valores[topo];
topo--;
return valor;
}
else return -1;
}
public string ImprimirPilha()
{
string saida = "\t";
if (topo >= 0)
{
for (int i = topo; i >= 0; i--)
{
saida = saida + valores[i] + "\n\t";
}
return saida;
}
else return "\tPilha Vazia";
}
}
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Pilha pilha = new Pilha(5);
int sair = 0;
string imprime = "";
while (sair == 0)
{
imprimeOpcoes();
int opcao = int.Parse(Console.ReadLine());
if (opcao == 0)
{
sair = 1;
}
else
if (opcao == 1)
{
Console.Clear();
Console.WriteLine("Digite um numero para inserir na pilha\n");
pilha.Push(int.Parse(Console.ReadLine()));
imprime = pilha.ImprimirPilha();
Console.WriteLine(imprime);
}
else
if (opcao == 2)
{
Console.Clear();
pilha.Pop();
imprime = pilha.ImprimirPilha();
Console.WriteLine(imprime);
}
else
if (opcao == 3)
{
Console.Clear();
imprime = pilha.ImprimirPilha();
Console.WriteLine(imprime);
}
}
}
static public void imprimeOpcoes()
{
Console.WriteLine("\nEscolha uma opção:\n");
Console.WriteLine("Sair digite 0");
Console.WriteLine("Inserir na pilha digite 1");
Console.WriteLine("Tirar da pilha digite 2");
Console.WriteLine("Imprimir pilha digite 3\n");
}
}
}
|
|
|
|
|
What exactly is your question? I hope you're not asking for someone to rewrite this for you?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
You do know that there's a Queue[^] collection in the System.Collections.Generic namespace, don't you?
You're kind of trying to reinvent the wheel here.
|
|
|
|
|
I'm guessing that's the whole idea - Computing Basics homework.
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
After looking at it again, you're probably correct.
|
|
|
|
|
Hello everybody!
i need a code that allows me to listen to event log using my application c#
i want my application to be able to detect if an events is raised!
for exemple :
the event : Source == DNS Clients events & Event_ID ==1014
thank you !
|
|
|
|
|
What have you tried? Where are you stuck?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
EventLog MyNewLog = new EventLog("System", ".", "DNS Client Events");
MyNewLog.EntryWritten += new EntryWrittenEventHandler(MyOnEntryWritten);
MyNewLog.EnableRaisingEvents = true;
signal = new AutoResetEvent(true);
Console.ReadLine();
}
public static void MyOnEntryWritten(object source, EntryWrittenEventArgs e)
{
if (e.Entry.InstanceId == 1014 || e.Entry.Source.Equals("DNS Client Events"))
{
MessageBox.Show("ERROER Event Raised");
}
}
|
|
|
|
|
First, why/how is the EntryWritten EventHandler working/not working for you /
CodeProject has many articles on using the System EventLog, like: "Enhanced EventLog writing for .NET Applications:" [^].
Also see: [^].
“I speak in a poem of the ancient food of heroes: humiliation, unhappiness, discord. Those things are given to us to transform, so that we may make from the miserable circumstances of our lives things that are eternal, or aspire to be so.” Jorge Luis Borges
modified 15-May-14 19:52pm.
|
|
|
|
|
Hi,
Is there a way to override the painting of a WinForms listbox's internal scrollbar ? (yes, WPF may be the solution, but I can't use it in my current project)
I've already done some researches but I didn't manage to find any solution
I think that the best solution would be to paint inside the WndProc method, but I don't know which message has to be intercepted...
May someone give me some advice or just a little tip ?
Thanks in advance
|
|
|
|
|
See this[^] article.
/ravi
|
|
|
|
|
Thanks for your link Ravi, but this component will not replace the internal scrollbar of the listbox...
It could be a solution to create my own usercontrol with a listbox and such a scrollbar, but I'll have to rewrite all listbox's methods to have my usercontrol having the same behavior as a classic listbox
|
|
|
|
|
I am able to find the Parent Window & its Child Windows, even I can find the position of the Parent Windows ... I can't find the position a its Child Window & its Child items (Button, Text Box ...)
1. The following codes to help me pinpoint the Parent & its Child Window:
IntPtr hwnd;
hwnd = FindWindow("ParentClass", "ParentTitle");
WindowsEnumerator enumerator = new WindowsEnumerator();
foreach (ApiWindow top in enumerator.GetTopLevelWindows())
{
foreach (ApiWindow child in enumerator.GetChildWindows(top.hWnd))
MessageBox.Show("Child Window = " + child.MainWindowTitle + ", Child ClassName = " + child.ClassName);
}
2. When I found an intended Child Window, I used:
IntPtr Chd_win = IntPtr.Zero;
Chd_win = FindWindowEx(hwnd_Parent, Chd_win, "ChildWindow_Class", "ChildWindow_Tiltle");
GetWindowRect(Chd_win, out rect);
MessageBox.Show("Child = " + Chd_win.ToString() + ": TopLeft_X = " + rect.Left.ToString() + ", TopLeft_Y = " + rect.Top.ToString());
*) The result shows always TopLeft_X = 0 & TopLeft_Y = 0
Anyone can help?
|
|
|
|
|
Can you find the control with Spy++? If not, then it might not be a real control, but simply a drawing.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I have use AutoIt Info to monitor all Child Windows, it found them ... however I amn't sure it works for C# ( it has Class, ClassNN,Title, Name, Advanced Class ...), I did try all of them but doesn't work well!
- As you suggested I am using SPY now to see it can help!
|
|
|
|
|
By using Spy I am now able to see my intended Child Windows with Handle, Caption & Class exact like the one I used ... I try it over & returning the same x=0 & y=0!
However, the AutoiT find tool shows its position correctly!
I can't use AutoIt with the current project (C# only) ... you can help?
|
|
|
|
|
Finally I found out (for now) I can't get their coordinations x,y of the Child Window.
However, since I am able to go directly into its instance ... therefore I no more need it!
Cheers
|
|
|
|
|
Grats
Bit late reply; there's a "managed spy++" for use with .NET apps. Would help if you need to access .NET specific properties.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|