|
So, just to recap. You're trying to:
a) Copy the currently running exe
b) Hide the console window
c) Block access to a folder
If this isn't something you shouldn't be writing then im the pope.
|
|
|
|
|
J4amieC wrote: then im the pope.
Cool, can I borrow your ferrari please
(I was also looking at his profile to see what exactly he is up to and I does seems like this program isn't on the safe side of things.)
|
|
|
|
|
J4amieC wrote: im the pope.
Stay away from those kids!
|
|
|
|
|
Rajdeep.NET wrote: I am trying to create a small utility which can block folders from direct access.
Yeah, with you're skill level, and total lack of knowledge in how Windows works, you're never going to pull this off.
|
|
|
|
|
Dear,
I have one problem, when i connect from my app to excel and when display the result I lost 1 row,
Why?
Please help me
Socheat
|
|
|
|
|
You need to be more specific. How did you connect to the excel? Was it the first row you lost?
My failometer is detecting vast quantities of FAIL!
"Its SQL - hardly programming..." (Caslen)
|
|
|
|
|
Dear
I Use like this
string strCnn="";
strCnn = "Provider=Microsoft.Jet.OLEDB.4.0;";
strCnn += " Data source=" + openFileDialog1.FileName;
strCnn += ";Extended Properties=Excel 8.0;";
OleDbConnection cn = new OleDbConnection(strCnn);
cn.Open();
string strsql="";
strsql = "SELECT * FROM [sheet1$]";
OleDbDataAdapter da = new OleDbDataAdapter(strsql, cn);
DataTable dt = new DataTable();
da.Fill(dt);
int i=0;
Application.DoEvents();
for (int k = 0; k < dt.Rows.Count; k++)
{
i++;
dgvSource.Rows.Add(i.ToString(), dt.Rows[k][0].ToString());
}
I got only 9 rows, but in fact in excel has 10 rows
Thanks
Socheat
|
|
|
|
|
Which row is missing? Is it the first one? If it is then you will notice that it is being used as the column titles. Use strCnn += ";Extended Properties=\"Excel 8.0;HDR=No;\""; to stop using the first row as the column headers, the default is HDR=Yes.
My failometer is detecting vast quantities of FAIL!
"Its SQL - hardly programming..." (Caslen)
|
|
|
|
|
Dear
I lose the first row.
I have include string connection like you wrote "HDR=No;" already but i got error Cound not find installable ISAM, so how can i do?
Socheat
|
|
|
|
|
Apologies, I used used the incorrect syntax:
string strCnn = string.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties=\"Excel 8.0;HDR=No;\"", openFileDialog1.FileName);
My failometer is detecting vast quantities of FAIL!
"Its SQL - hardly programming..." (Caslen)
|
|
|
|
|
Dear,
Thanks, it work well now
Socheat
|
|
|
|
|
Hi guys,
How can I hide the black window which appears during the execution of a console application? I want to hide it, becasue I have a program which doesn't accept any user input and just goes on performing some specific tasks which takes quite long time.
Thanks,
Cheers,
Rajdeep.NET
|
|
|
|
|
|
No need to change your existing code just change your project output type as Windows Application instead of Console Application.
How to change your project output type
1. from your solution explorer right click your console project then choose Property menu.
2. from the application tab change the value of Output type dropdownlist.
Happy coding...
|
|
|
|
|
Thanks Mark, that worked very well..... thanks for preventing me from implementing DLL calling codes to the project.
|
|
|
|
|
Rajdeep.NET wrote: How can I hide the black window which appears during the execution of a console application? I want to hide it, becasue I have a program which doesn't accept any user input and just goes on performing some specific tasks which takes quite long time.
Don't run a console application then. If you have an application that doesn't require user interaction, write it as a service instead.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Alright.... I will remember that.
Thanks,
Rajdeep.NET
|
|
|
|
|
Red flags all over all your posts.
|
|
|
|
|
Hello all
I am building a website and I want to store the current time in a database, thats not a problem.
But I also want to make the time format changable. For example if I have "May 2 2009" stored in the database and I decide I want to change the format to "5/2/2009", I need to either update the database or use a neutral date format that can be converted to the date format I want.
Any tips on this? I thought about using timestamp, but cant rellay see where it fits in
Thanks
|
|
|
|
|
Just save the datetime in DateTime format in database, not in string.
|
|
|
|
|
|
He means that a datetime is a number[^], and as such, is neutral. To quote;
SQL Server uses 8 bytes to store the datetime data type. The first 4 bytes make up an integer value that represents the number of days since January 1, 1900. The second 4 bytes are an integer value that represents the number of milliseconds since midnight.
When you send a date to the database, do you convert it to a string that get's included in your (text) command? If so, then you can get errors converting from/to the wrong format. If you send it as a number, then it will be interpreted as a "days past since date 1"-number.
Try casting a date to float/integer, and see what happens
I are troll
|
|
|
|
|
|
If you want to catch the messages, use this in your form class.
protected override void WndProc(ref Message m)
{
base.WndProc(ref m);
}
|
|
|
|
|
Hi there......
Thanks for your help. I need to know how to process a WM_CHAR message sent by other application using SENDMESSAGE API.
I want to receive any keyboard stroke. As you suggested I used :
protected override void WndProc(ref Message m)
{
base.WndProc(ref m);
if (m.Msg == WM_CHAR)
MessageBox.Show(m.Msg.ToString());
}
But it gives an error for WM_CHAR. So please tell me how to catch any keyboard event.
Thanks a ton.....
Vishal Moharikar.
|
|
|
|