|
Better idea. Don't set a reference to the .DLL file itself. Set a reference to the .DLL PROJECT. When you compile the application, it'll use the latest build of the .DLL automatically.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi i want to get the file name with path of that file that is (open, Rename, Delete, Modify) by the user. i use FSW (File system watcher class) it give me info about (Rename, modify, delete). but how i get event that which file is opened by the user by mouse or keyboard. Is there any class which capture events that any file is opened in a system. Plz reply
Mazhar
|
|
|
|
|
m_mazhar wrote: Is there any class which capture events that any file is opened in a system. Plz reply
No, there isn't. This requires hooking into the NTFS filesystem. Check out FileMon[^] at SysInternals. There is a list of references that was used (all books!) to build that utilities abilty to do just what you want.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi all,
I'm writing a C# add-in, I need the current project directory in my code (not the runtime IDE's projects).
e.g. I write code in C:\Documents and Settings\f-xidwu\My Documents\Visual Studio Projects\winConsole\winConsole.cpp, thus how can I get C:\Documents and Settings\f-xidwu\My Documents\Visual Studio Projects\winConsole path?
|
|
|
|
|
|
hi,Application.startpath or executablepath will lead to the application directory which contain the .exe file (sometimes debug directory), but not the project directory.
ps: an add-in's .exe directory is C:/Program Files/.../Comman7/IDE/ usually.
|
|
|
|
|
You can't get the project directory at runtime, simply because it's not the individual CS files that run the application, but the exe or dll built from them. The only way I know is to hardcode the strings inside the files themselves.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hi,
My Application currently have an embedded MS Access Database, the Connection String as follow:
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=..\\..\\DataBase\\DataBase.mdb"
but every time when i publish my application and execute, it pops an Error message saying the Data Source Path is invalid. It seems like the Current Working Directory is somewhere in the memory, not the file location.
How can i setup it up so that no matter where the application is located, as long as the DataBase.mdb file is in the same directory, it knows where to find it?
Thanks alot
Need Help
Thank you very much
|
|
|
|
|
Hi all,
I'm making a ListView like a break point window, when someone insert a new breakpoint on the margin indicator or through the insert break point dialog, even when press F9, I want my listview to refresh.
I've searched a lot, but seems nothing useful. What should I do? what's the right event or command?
3x.;P
Xiaodao
|
|
|
|
|
hi all,
i have a problem dealing with cascading style sheet.
how do i link my style sheet (placed background pic inside) to Default.aspx (example).
i want the picture to appear when i run Default.aspx
error occurs when i tried.
error message:-
Error 1=> Cannot switch views: Validation (XHTML 1.0 Transitional): Element 'link' cannot be nested within element 'html'.
where shall i put this link then?
link: thanks for the help..
-DarkangeL-
|
|
|
|
|
|
thanks for your help..
i can do it already..
thanks again..
-DarkangeL-
|
|
|
|
|
Hi, I was wondering if anyone has come across a solution to this problem, I need to get all possible unique permutations for a list of numbers (as sourced from a flagged enumeration). For example:
Enum def:
In = 1
Out = 2
Over = 4
Hover = 8
Would equate to:
In, Out, Over, Hover
In, Out, Over
In, Out
In, Over
In, Hover
In, Over, Hover
In
Out, Over, Hover
Out, Over
Out, Hover
Out
Over, Hover
Over
Hover
I need to end up with a list of all the possible permutations this enumeration could possibly be. A rather larget snag is that it could be any flagged enumeration, the method needs to take a type (which will be an enumeration type) and dynamically work out this list at run-time.
I think this is correct, the list looks unique but its late and I need sleep! Any help would be appreciated!
Thanks,
Kieron
|
|
|
|
|
Here's one way to generate the output you're looking for. An alternative approach is to set some enum value to each subset of all possible values, calling the Enum.ToString() method on every iteration.
<br />
[Flags]<br />
enum testenum { In, Out, Over, Hover }<br />
<br />
static void PrintFlags(string[] names, IList curnames, int idx) {<br />
<br />
if (idx == names.Length) {
if (curnames.Count == 0) {<br />
System.Console.WriteLine("[None]");<br />
} else {<br />
for (int i = 0; i < curnames.Count - 1; i++)<br />
System.Console.Write("{0}, ", curnames[i]);<br />
System.Console.WriteLine(curnames[curnames.Count - 1]);<br />
}<br />
return;<br />
}<br />
<br />
curnames.Add(names[idx]);<br />
PrintFlags(names, curnames, idx + 1);<br />
<br />
curnames.RemoveAt(curnames.Count - 1);<br />
PrintFlags(names, curnames, idx + 1);<br />
}<br />
<br />
static void Main(string[] args) {<br />
<br />
string[] names = Enum.GetNames(typeof(testenum));<br />
ArrayList curnames = new ArrayList(names.Length);<br />
PrintFlags(names, curnames, 0);<br />
<br />
}<br />
Hope this helps!
|
|
|
|
|
Hi, thats excellent! Works a treat, thanks very much! (:
|
|
|
|
|
|
This builds an ArrayList of all combinations of the enum, then dumps it to the console. This approach doesn't use recursion or ArrayList manipulation.
using System;
using System.Collections;
public class MyClass
{
[Flags]
enum testEnum
{
In,
Out,
Over,
Hover
}
static void Main (string[] args)
{
string[] names = Enum.GetNames (typeof (testEnum));
ArrayList[] list = GetCombinations (names);
foreach (ArrayList items in list)
for (int i = 0, last = items.Count - 1; i <= last; i++)
Console.Write (items [i] + (i < last ? ", " : "\n"));
Console.ReadLine();
}
static ArrayList[] GetCombinations (string[] a)
{
int count = TwoPow (a.Length) - 1;
ArrayList[] list = new ArrayList [count];
for (uint i = 1; i <= count; i++)
{
ArrayList items = new ArrayList();
for (uint j = 0, bits = i; bits != 0; j++, bits >>= 1)
if ((bits & 1) != 0)
items.Add (a [j]);
list [i - 1] = items;
}
return list;
}
static int TwoPow (int e)
{
int p = 1;
for (int i = 0; i < e; i++)
p <<= 1;
return p;
}
}
Fatgeek
|
|
|
|
|
Hello,
I have a setup project that installs a windows service as well as a stand alone application. The setup project also includes a custom action which writes an xml config file. All works fine on the install, but on the uninstall (from control panel > add remove programs) it does not unregister the service. Is there something im missing in the setup project or is there a need for another custom action?
thanks
|
|
|
|
|
have u stopped ur service before uninstalling????
sathy
|
|
|
|
|
yup, what essentially ends up happening is that you have to remove the registry key to remove it after the uninstall.
any idea?
|
|
|
|
|
r u sayin tht u have to manually remove the registry keys...
i tried on creatin a setup for a windows service it is installing and i can also uninstall it.. but i cant start the service... it throwin an error sayin JIT debuggin failed
sathy
|
|
|
|
|
I have a list definition,
public class List<br />
{<br />
private int index;<br />
private string name;<br />
<br />
}
and a table
<br />
public class Table<br />
{<br />
public static List List1 = new List(1,"List1");<br />
public static List List2 = new List(2,"List2");<br />
...<br />
<br />
}
Now , if I want to add a method of Table
public class Table<br />
{<br />
public static List GetListFromIndex( int index){...}<br />
}
How can I avoid a lot of "switch case"????
Thanks!. I know this maybe related to "reflection" , but cannot figure it out.
|
|
|
|
|
I don't know background so I must ask, why you dont use standard Array(List) of strings?
I mean (example),
public class Table
{
static ArrayList list;
public static string GetListFromIndex(int i){return (string)list[i];}
}
Never forget: "Stay kul and happy" (I.A.)
David's thoughts / dnhsoftware.org / MyHTMLTidy
|
|
|
|
|
I'm sure this has been asked before, but I having difficulty finding the correct phrasing to return a valid search.
I would like to beable to send data to another application from my application.
For instance, if I have an already existant application that I have to type the same info into it each time I use it, several times a day where the only information that changes is a serial # and/or a product name.
I would like to build a soulution that would allow me to pre-program the data fields so that all I have to do is click a button and it populates all of the semi-static fields.
Any Ideas of what I would need to do, or where I need to look to find this answer?
string Beautiful;
Beautiful = "ignorant";
label1.Text = "The world is full of " + Beautiful +" people.";
Why is common sense such an un-common comodity?
|
|
|
|
|
Hi,
I have a datagrid & a datatable, and when I use the mousemove event, I run into trouble.
private void dgMouseMove(object sender, System.Windows.Forms.MouseEventArgs e)<br />
{ <br />
System.Windows.Forms.DataGrid.HitTestInfo hitInfo = dg.HitTest(new Point(e.X, e.Y));<br />
... // find out which cell is entered
dg.CurrentCell = new DataGridCell(hitInfo.Row,hitInfo.Column);<br />
... // use tooltip
}
The problem starts when I set dg.CurrentCell. Whatever it's set to, the backcolor of that cell changes to what looks like some default color (biege), and the text is highlighted. Also, the MouseUp event doesn't seem to fire, at least not consistently. I've been trying to figure this one out for a while now, and am pretty stuck. Anyone know what to do? You'd be my hero!
Thanks,
Mel
|
|
|
|