|
worked.It is great.Thank you so much.
|
|
|
|
|
Console.WriteLine("Press any key to Continue");
Console.ReadKey();
the second statement is optional.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
And a less user-friendly variant:
while (true)
{
Console.WriteLine("Continue to press any key.");
Console.ReadKey();
}
|
|
|
|
|
Alternate implementation. I actually think the other solution is better, but I was curious if this would work (and it does). Note that UseShellExecute is important, otherwise the process is opened in a new window. The disadvantage is that you're more tightly coupled with the OS (i.e. it wouldn't work under Mono on a non MS-platform)
using System.Diagnostics;
ProcessStartInfo psi = new ProcessStartInfo("cmd", "/c pause");
psi.UseShellExecute = false;
Process.Start(psi).WaitForExit();
|
|
|
|
|
Or run it from a BAT file.
myapp.exe
pause
|
|
|
|
|
@echo off
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
I didn't want to confuse the reader with such details.
|
|
|
|
|
Hi All, I am facing a problem when I try to insert into sqlite database.
sql_cmd.CommandText = "INSERT INTO test('name')VALUES ('Value2')";
it is giving me error saying test table does not exist but in reality it does.
can you please tell me what I am doing wrong.
thanks in advance.
|
|
|
|
|
Have you asked or looked here[^]
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Message Closed
modified 23-Nov-14 7:25am.
|
|
|
|
|
Hi stancrm, I did try it but did not work. I try also other suggestion too. Nothing is working.
Thanks for you help. if you know anything else I will give a try.
thanks
|
|
|
|
|
Hi All,
Try to run this command in sql server u will come to know what is the problem.
Thanks,
Amit Patel
|
|
|
|
|
I believe that column-names aren't enclosed in quotes;
sql_cmd.CommandText = "INSERT INTO test (name) VALUES ('Value2')";
I are Troll
|
|
|
|
|
Hi all!
I'm trying to get the use ratio of the network , just like the network used(eg. 0.01%) in the task manager.
I tried to realize that through using ManagementClass,but failed.Would you like to show me how to realize that?
Thank you!
--------------------------------------
ManagementClass mc = new ManagementClass("Win32_NetworkAdapter");
ManagementObjectCollection moc = mc.GetInstances();
foreach (ManagementObject mo in moc)
{
string a = mo["Speed"].ToString();//mo["Speed"] is NULL
Console.WriteLine(a);
}
|
|
|
|
|
Message Closed
modified 23-Nov-14 7:25am.
|
|
|
|
|
That's just what I want.Thank you very much!
|
|
|
|
|
Hi,
I want to configure the DHCP server programmatically tjrough C#,
I am able to create the subnet , get the lease infomation from DHCP server etc.
Now I need to set the Options for DHCP server programatically.
I tried to but not getting how can I add DNS server option on subnet through code.
Regards
"A winner is not one who never fails...but the one who never quits"
|
|
|
|
|
Hi All,
I am implementing CD burning in my application. I am able to burn CD but for showing progress % i m using Back Ground Worker.
2 events of back ground worker Do work and Runworkercompleted is getting called but
backgroundBurnWorker_ProgressChanged is not getting called.
Thanks and Regards,
Amit Patel
|
|
|
|
|
I think without some code its hard to say where your problem lies.
Greetings
Covean
|
|
|
|
|
Message Closed
modified 23-Nov-14 7:25am.
|
|
|
|
|
inside Do i m doing this following thing
MsftDiscRecorder2 discRecorder = new MsftDiscRecorder2();
BurnData burnData = (BurnData)e.Argument;
discRecorder.InitializeDiscRecorder(burnData.uniqueRecorderId);
discRecorder.AcquireExclusiveAccess(true, m_clientName);
MsftDiscFormat2Data discFormatData = new MsftDiscFormat2Data();
discFormatData.Recorder = discRecorder;
discFormatData.ClientName = m_clientName;
discFormatData.ForceMediaToBeClosed = checkBoxCloseMedia.Checked;
object[] multisessionInterfaces = null;
if (!discFormatData.MediaHeuristicallyBlank)
{
multisessionInterfaces = discFormatData.MultisessionInterfaces;
}
IStream fileSystem = null;
if (!CreateMediaFileSystem(discRecorder, multisessionInterfaces, out fileSystem))
{
e.Result = -1;
return;
}
discFormatData.Update += new DiscFormat2Data_EventHandler(discFormatData_Update);
try
{
discFormatData.Write(fileSystem);
e.Result = 0;
}
catch (COMException ex)
{
e.Result = ex.ErrorCode;
MessageBox.Show(ex.Message, "IDiscFormat2Data.Write failed",
MessageBoxButtons.OK, MessageBoxIcon.Stop);
}
discFormatData.Update -= new DiscFormat2Data_EventHandler(discFormatData_Update);
if (this.checkBoxEject.Checked)
{
discRecorder.EjectMedia();
}
inside discFormatData.Write(fileSystem);
this call the follwing m_UpdateDelegate(sender, args);
this calles the
void discFormatData_Update([In, MarshalAs(UnmanagedType.IDispatch)] object sender, [In, MarshalAs(UnmanagedType.IDispatch)] object progress)
{
if (backgroundBurnWorker.CancellationPending)
{
IDiscFormat2Data format2Data = (IDiscFormat2Data)sender;
format2Data.CancelWrite();
return;
}
IDiscFormat2DataEventArgs eventArgs = (IDiscFormat2DataEventArgs)progress;
m_burnData.task = BURN_MEDIA_TASK.BURN_MEDIA_TASK_WRITING;
m_burnData.elapsedTime = eventArgs.ElapsedTime;
m_burnData.remainingTime = eventArgs.RemainingTime;
m_burnData.totalTime = eventArgs.TotalTime;
m_burnData.currentAction = eventArgs.CurrentAction;
m_burnData.startLba = eventArgs.StartLba;
m_burnData.sectorCount = eventArgs.SectorCount;
m_burnData.lastReadLba = eventArgs.LastReadLba;
m_burnData.lastWrittenLba = eventArgs.LastWrittenLba;
m_burnData.totalSystemBuffer = eventArgs.TotalSystemBuffer;
m_burnData.usedSystemBuffer = eventArgs.UsedSystemBuffer;
m_burnData.freeSystemBuffer = eventArgs.FreeSystemBuffer;
backgroundBurnWorker.ReportProgress(0, m_burnData);
}
|
|
|
|
|
BackgroundWorker has a WorkerReportsProgress property. Have you set it to true ?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi All,
I set worker report progress to true.
Thanks and regards,
Amit Patel
|
|
|
|
|
four cards from deck r upturned
below each upturned card is an arrow pointing upward or downward
depending upon the direction of the arrow,the players need to place apprpriate on the upturned cards..if the arrow points upwards,a player needs to place a card numbered one more then that on the upturned card. if the arrow points downwards,a player needs to place a card numbered one less than that on the upturned card..
when a player places his or her card on one of the upturned cards,the vacant slot is occupied by a card from his deck....at any point a player should be able to see four of his cards unless his deck does not have that many cards..
any player can place apprpriate card in any of the upturned cards,,,therefore he needs to act n think fast..
if none of the players is able to make a move ,the flip card is displayed ..if the player clicks flip card,the upturned cards in the center are changed,,
the players need to keep placing their cards on the upturned cards, a player who first places 20 of his cards on the upturned cards,wins the game..
|
|
|
|
|