|
ravindervilasagar wrote: Please Send some code. Please..please..please There you are;
Console.WriteLine("Hello world");
If you need more code, I suggest you learn to WRITE it, or HIRE someone who can. No-one is going to write your work, based on your wishes, "just for the fun of it".
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Please read How to get an answer to your question [^] Specifically item 1. Also, in general, it helps to add what you have tried and what is going wrong, otherwise people here will assume you just want the code written for you. If you are having problems getting started, say so though a quick Google search[^] has at least two results that should get you started, so I doubt that is the case here.
|
|
|
|
|
Hi,
I wish to start and run an application automatically.
I can create a task in Task Scheduler (It's still called this in Vista, don't know about windows nt, 7 or 8) to start the application daily at a specific time. No problem.
However, I actually want the app to perform some functions.
I'm thinking that passing some command line parameter through to the app when it starts through the task I've set up but a) I'm not sure how to do that
in Task Sceduler and b) hot sure what code I need to include in the application to pick up on the command line parameter.
I'm using c# 3.5 and viz stud 2008 and i guess it's a winform application at the mo too.
thanks
Mat
|
|
|
|
|
matleeds wrote: I'm thinking that passing some command line parameter through to the app when it starts through the task I've set up but a) I'm not sure how to do that
in Task Sceduler and b) hot sure what code I need to include in the application to pick up on the command line parameter.
Picking up command line parameters works the same for all; you have a main-method, and if correct, it'll have an array of string that hold the params.
Take a look at the example here[^].
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Hey thanks,
command line args 101...it's just been ages since I've had to use them. Task scheduler also has a property for adding the command line arg as well..so job done, cheers
Mat
|
|
|
|
|
why you use VS code? code by cmd very hard
|
|
|
|
|
Hi coders out there, i am a fresh man in C#, now i have want to select maximum member_id from mysql, use the returned value from cmd as a string variable to use elsewhere in the application, someone help, please?
|
|
|
|
|
Help with what? Writing the Sql-query, or writing the C# code? What have you tried so far?
And which university?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
|
MySQL
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Eddy Vluggen wrote: MySQL
I really didn't saw that.
------------------------------
Author of Primary ROleplaying SysTem
How do I take my coffee? Black as midnight on a moonless night.
War doesn't determine who's right. War determines who's left.
|
|
|
|
|
suppose I have the code was inserting records into the file c: \ \ test.dat see the code http://www.koders.com/csharp/fid4FB06ED9F7F6AA6BB805F9152B3DB29BBD1D0C61.aspx?s = CDEF% 3Afile
ith now want to delete the records in the file c: \ \ test.dat I can copy the code
btnAppend_Click to delete sample letter how i
code:
'Add items
private void btnAppend_Click (object sender, System.EventArgs e)
{
....
sf.Open (System.IO.FileMode.Append, System.IO.FileAccess.Write, System.IO.FileShare.None);???
...
}
'Delete the ith sample
private void btnDelete_Click (object sender, System.EventArgs e)
{
....
sf.Open (System.IO.FileMode.Append, System.IO.FileAccess.Write, System.IO.FileShare.None);???
...
}
|
|
|
|
|
The steps are generally pretty simple. Read the file in, and look for the record you want to delete. Delete the record. Save the file back out.
What, exactly, are you having trouble with?
|
|
|
|
|
Looks like a spooky way to serialize something. I suggest you use a BinaryFormatter , and use a Collection to manipulate the data.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
for example: add, delete, edit, ... struct binary record form and load the data into the listview? I'm using C # 2005, if you share yourself with, thank you
|
|
|
|
|
Same way as for a text file.
1. Open file
2. Read to just before place you want to delete.
3. Mark that spot - call it A.
4. Read to just after you want to delete.
5. Keep reading but as you read write back to position A (incrementing A as you go of course.)
6. Keep going until you reach the end of the file.
|
|
|
|
|
I would like to know when a program was installed on a remote machine.
I can read HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\[XXXXXXX] remotely, but I can't seem to translate the UninstallString into a date remotely via MSIGetProductInfo, so I then tried to see if I could read the keys last modified date via RegEnumKeyEx and did not have success there either. If anyone knows how to do this, I would be very appreciative, I cannot find a single working example of RegEnumKeyEx so that I can plug in a server name, hive, path and key name to test with.
Thank you for reading.
|
|
|
|
|
Here is the function I ended up writing for this in case this comes up in a search. Future readers ... any questions, just ask
[DllImport("Advapi32.dll", EntryPoint = "RegEnumKeyExW")]
private static extern int RegEnumKeyEx(
UIntPtr hKey,
int dwIndex,
[MarshalAs(UnmanagedType.LPWStr)] StringBuilder lpName,
ref int lpcName,
int lpReserved,
int lpClass,
int lpcClass,
[MarshalAs(UnmanagedType.Struct)] out System.Runtime.InteropServices.ComTypes.FILETIME lpftLastWriteTime
);
public static string reg64readerModifiedDate(string serverName, string hive, string keyPath, string stringValue)
{
uint hiveConst = HKEY_LOCAL_MACHINE;
switch (hive)
{
case "hkcr":
hiveConst = HKEY_CLASSES_ROOT;
break;
case "hkey_classes_root":
hiveConst = HKEY_CLASSES_ROOT;
break;
case "HKCR":
hiveConst = HKEY_CLASSES_ROOT;
break;
case "HKEY_CLASSES_ROOT":
hiveConst = HKEY_CLASSES_ROOT;
break;
case "hkcu":
hiveConst = HKEY_CURRENT_USER;
break;
case "hkey_current_user":
hiveConst = HKEY_CURRENT_USER;
break;
case "HKCU":
hiveConst = HKEY_CURRENT_USER;
break;
case "HKEY_CURRENT_USER":
hiveConst = HKEY_CURRENT_USER;
break;
case "hklm":
hiveConst = HKEY_LOCAL_MACHINE;
break;
case "hkey_local_machine":
hiveConst = HKEY_LOCAL_MACHINE;
break;
case "HKLM":
hiveConst = HKEY_LOCAL_MACHINE;
break;
case "HKEY_LOCAL_MACHINE":
hiveConst = HKEY_LOCAL_MACHINE;
break;
case "hku":
hiveConst = HKEY_USERS;
break;
case "hkey_users":
hiveConst = HKEY_USERS;
break;
case "HKU":
hiveConst = HKEY_USERS;
break;
case "HKEY_USERS":
hiveConst = HKEY_USERS;
break;
case "hkcc":
hiveConst = HKEY_CURRENT_CONFIG;
break;
case "hkey_current_config":
hiveConst = HKEY_CURRENT_CONFIG;
break;
case "HKCC":
hiveConst = HKEY_CURRENT_CONFIG;
break;
case "HKEY_CURRENT_CONFIG":
hiveConst = HKEY_CURRENT_CONFIG;
break;
case "hkdd":
hiveConst = HKEY_DYN_DATA;
break;
case "hkey_dyn_data":
hiveConst = HKEY_DYN_DATA;
break;
case "HKDD":
hiveConst = HKEY_DYN_DATA;
break;
case "HKEY_DYN_DATA":
hiveConst = HKEY_DYN_DATA;
break;
case "hkpd":
hiveConst = HKEY_PERFORMANCE_DATA;
break;
case "hkey_performance_data":
hiveConst = HKEY_PERFORMANCE_DATA;
break;
case "HKPD":
hiveConst = HKEY_PERFORMANCE_DATA;
break;
case "HKEY_PERFORMANCE_DATA":
hiveConst = HKEY_PERFORMANCE_DATA;
break;
default:
MessageBox.Show("Default");
break;
}
UIntPtr key = new UIntPtr(hiveConst);
IntPtr remKey;
int ret = RegConnectRegistry(serverName, key, out remKey);
UIntPtr remKeyUIntPtr = unchecked((UIntPtr)(long)(ulong)remKey);
string result = GetRegKey64DWord(remKeyUIntPtr, keyPath, RegSAM.WOW64_64Key, stringValue);
uint lpcbData = 1024;
StringBuilder strBuffer = new StringBuilder(1024);
int dIndex = 0;
int lpcName = 1024;
int lpClass = 1024;
int lpcClass = 1024;
System.Runtime.InteropServices.ComTypes.FILETIME lpftLastWriteTime = new System.Runtime.InteropServices.ComTypes.FILETIME();
RegEnumKeyEx(remKeyUIntPtr, dIndex, strBuffer, ref lpcName, 0, 0, 0, out lpftLastWriteTime);
long hFT2 = (((long)lpftLastWriteTime.dwHighDateTime) << 32) + lpftLastWriteTime.dwLowDateTime;
DateTime dt = DateTime.FromFileTime(hFT2);
RegCloseKey(remKey);
result = dt.ToString();
return (result);
}
|
|
|
|
|
You could remove half of those case s by normalizing the capitalization. Do a ToUpper and the code will be a bit smaller/easier to read.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
That's a great point, I am going to clean up the code soon and that is one of the first things I'll do
|
|
|
|
|
Hi experts,
i want to display data in gridcontrol like all columns headings should be named as given date range daily, weekly and monthely. in each row data should display against each date with each id number of employee.
thanks
|
|
|
|
|
So what is your question?
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Yes it can be done!
But you need to expand / explain your problem, what you have tried or even show code detailing where its going wrong and detailing as much as you can and include errors where possible.
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|
|
ok thanks.
actually i didn't build yet therefore i can't provide code.
i want to build. i am trying to build 20 employees duty and want to see their roster in gridcontrol.
all employees section wise or id wise should display left side of the grid date range should display on columns headings and employees duty timinges should appear in cells all these should be from access database table.
|
|
|
|
|
Okay, so when you've built some of it, feel free to pop back with any questions on the code you've written - we'll be glad to help you fix things.
|
|
|
|