|
I'm nor sure you can get windows explorer to run a file, if you do a FileDrop into windows explorer I'm pretty sure it will just move the file. If you want to execute the file afterwards you'd have to find out where you dropped it, unless by run you actually mean you just want explorer to copy/move the file.
Either way, you can do a FileDrop from your app to windows explorer like so:
void TreeView1ItemDrag(object sender, ItemDragEventArgs e)
{
string[] stuff = new string[1];
stuff[0] = 'path to file';
.
DataObject data = new DataObject(DataFormats.FileDrop, stuff);
.
this.treeView1.DoDragDrop(data, DragDropEffects.Copy);
}
Of course if your using a listView or something else your obviously gonna need to change that a little. Multiple files at the same time would just require you to add more paths to the string array.
My current favourite word is: I'm starting to run out of fav. words!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
yes yes i did that already, now i just want to run that dropped file, but dunno where to get its path
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
I don't think you can, explorer handles the drop event and your application sees nothing more of it. You could get the handle to an open explorer window and perhaps find what folder is open, but you wouldn't know which window(if there was more than one) or if the user had to rename a file or cancel the move/copy.
My current favourite word is: I'm starting to run out of fav. words!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
yes, i'm trying to do this thing for around 2 days but nothing found that can help , is there anyway to know what window we release the mouse ?
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
are you asking about executing a program from Windows Explorer by dragging and dropping a target file onto it? If so then write your program to handle command line args. By default the paths of files dropped onto a program icon are passed to the Main function as parameters.
If that's not what you're asking about then you might want to clarify your question.
|
|
|
|
|
no thats not what i want
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
When the file drag is completed - the foreground window is changed. You could use GetForegroundWindow from user32.dll to find which window is currently active at the end of the drag operation. I'm not sure how you'd get the path from it though. If the 'Display the full path in the title bar' option is enabled on the system, then you could use GetWindowText from user32.dll to get the path (if it's the desktop the text is 'Program Manager').
Once you get the path you can then use Process.Start
Dave
|
|
|
|
|
thanks man for info, i will try it and reply soon
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Hi All,
Every time i try to execute a project i am coming up with the above error.
Can any one advice on the problem?
Thank you
regards
|
|
|
|
|
Hi,
You may try the following options:
1) Verify that the file 'C:\WINNT\Microsoft.NET\Framework\v2.0.50727\WebDev.WebServer.exe' exists. Visiaul Studio installs the necessary file in the v2.0 framework folder by default. Removing the framework would screw up the local server option.
2) If you are running 64 bit machine then check out the following link:
http://support.microsoft.com/kb/920719
Hope this helps
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
hey guys
ive got two dataTables and two DataGrids on a form
The first datagrid's data is bound perfectly, now on a button click i need to add the selected row of the 1st DataGridView to the 2nd dataGridViews dataTable and remove it from the first
i tried this to remove the row...
private void button1_Click(object sender, EventArgs e)
{
foreach (DataGridViewRow row in dataGridView1.SelectedRows)
{
avalibalTimeCatRow = avalibalTimeCatTable.NewRow();
avalibalTimeCatRow[avalibalTimeCatIdColumn] = Int32.Parse(row.Cells[0].Value.ToString());
avalibalTimeCatRow[avalibalTimeCatNameColumn] = row.Cells[1].Value.ToString();
avalibalTimeCatTable.Rows.Remove(avalibalTimeCatRow);
}
}
the error is " The given DataRow is not in the current DataRowCollection. "
any other ideas on how to remove the row?
thanx
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
replace the error line with this
dataGridView1.Rows.Remove(row); , you were deleting a row that is not exist in that table thats what error is saying
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
i tried that aswell before posting... the problem with that is the table.row is of type DataRow, which the remove method expects, and the dataGrids row is of type DataGridViewRow
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
will you try again with that code line i gave you ? i'm sure it will work
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
i did, the problem is the method expects a DataRow and im inserting a DataGridViewDataRow if i table.Rows.Remove(row);
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
i said this :
dataGridView1.Rows.Remove(row);
Not this :
table.Rows.Remove(row);
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
it works
that doesnt make sense, does the dataGridView automatically change its dataSource if i change the data in the datagrid view?
thanx
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
yes of course
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
i didnt know that
thank you
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
Hi
I guess you have to select the rows in the datatable and then delete it.
foreach (DataGridViewRow row in dataGridView1.SelectedRows)
{
DataRow[] selectedRows = avalibalTimeCatTable.Select("IDColumnsName = " + row.Cells[0].Value.ToString());
foreach (DataRows rowtoDelete in selectedRows)
{
avalibalTimeCatTable.Rows.Remove(rowtoDelete);
}
}
Not tested
Might fail in the foreach loop.
Kjetil
|
|
|
|
|
YOUR A GENIUS!!!!!!!!!
it worked like a charm!!!
thanx
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
I have two tables in my MS SQL database. The first one (Publication) contains all sorts of information about books, and has one foreign key (AuthorID). The second table (Author) contains the names of the authors. Now, I need to sort the first table, alphabeticaly, by the authors names. But all I succeeded in doing so far was to sort it by Authors IDs. If anyone has an idea on how to solve this, any help would be greatly appreciated.
Thanks.
|
|
|
|
|
I don't know, but I suspect you'll need classes from System.DirectoryServices, perhaps DirectorySearcher.
|
|
|
|
|
Hello.
I have been creating a application that checks the application version and sees if it fits with the version from http://msbeditor.dumpen.dk/versioninfo.html
If it doesnt I use a webBrowser component to open a download link to http://msbeditor.dumpen.dk/msbEditor.rar
But this is not very practical because, the ones using my application have to download all files even though some of the files are not changed..
So I wanted to ask if you have an idea on how to make a auto updater in C#?
I was thinking of something like:
Check the application version with the online version (Allready done)
If it doesnt fit, then match all the files (last changed or file size or similar) in the rar file (from msbeditor.dumpen.dk) with the files in the application folder
If they are changed then download the changed files
Any ideas?
|
|
|
|
|
Sounds okay. You can create an additional updater application that will download the files and then update your main application when finished.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|