|
Exactly. The keep alive command is only a command to be executed, that will not cause any data changes and is fast. It will only force the connection to be used.
|
|
|
|
|
Hi,
Is there any way to show "Press any key to Continue" message end of the run VS Console application.
|
|
|
|
|
yakupc wrote: Is there any way to show "Press any key to Continue" message end of the run VS Console application
Within Visual Studio if you start debugging with Ctrl-F5 it will do it automatically.
When you run your program outside this environment you will need to code it yourself (Console.Write and Read ).
|
|
|
|
|
By default, "Ctrl+F5" is mapped to "Start Without Debugging"
|
|
|
|
|
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);
}
|
|
|
|