|
Turns out my math was wrong with what I was drawing, so I was drawing stuff outside the bounds of the control.
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
Hello,
Maybe you forgot to path, the base.OnPaint(..) in your "overrided"??? OnPaint Method.
All the best,
Martin
|
|
|
|
|
Turns out my math was wrong with what I was drawing, so I was drawing stuff outside the bounds of the control.
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
Hi,
I'm having troubles finding information about drag&drop support for tray icons. I know you can drag&drop on a lot of controls in C#, but the events are not listed for the "notifyicon" (aka tray icon).
Has anyone tried this before ? Google didn't really help me on the matter either.
|
|
|
|
|
Hello
I guess you should handle the NotifyIcon.MouseUp event, but where to go from there is up to you
Regards
|
|
|
|
|
I don't think that'll work since you need to have something like the "DragEventArgs" to see which data is being drag&dropped.
And I don't know that much about changing controls to implement that into the notifyicon control
|
|
|
|
|
Hello
AFAIK and someone correct me if I'm wrong. Drag/Drop operation puts info about the dragged data in the clipboard if not the data itself. That's where the dropped in control knows what is dropped in it.
So, just try fetching them from the clipboard.
Regards
|
|
|
|
|
I need to be able to determine what user name a process is running under. I can get the process object by using...
Process[] p = Process.GetProcessByName("theprocess");
But I need to know if the process is running under the same user name as the account that the current user is logged in under. I know I can get the user name with Environment.Username, but I need to get the process' user name like Task Manager does.
Can anyone help?
Darryl Borden
Principal IT Analyst
dborden@eprod.com
|
|
|
|
|
Hello
Process[] p = Process.GetProcessByName("theprocess");
MessageBox.Show(p.StartInfo.Username);
Regards
|
|
|
|
|
I found a previous reference to that, but the StartInfo object that comes up in my IDE does not have a "Username" property.
Darryl Borden
Principal IT Analyst
dborden@eprod.com
|
|
|
|
|
Hello
ProcessStartInfo.Usename property is available in .net framework 2.0 or later. Probably you're using version 1.1 or 1.0. Upgrade to .Net 2.0 by buying Visual Studio 2005, downloading Visual C# express edition, or downloading .Net 2.0 SDK and using its libraries explicitly.
Regards
|
|
|
|
|
Use WMI or Windows Management Instrumentation. Build a Management Object on the process under discussion. Call its InvokeMethod() and pass "GetOwner" as the method parameter. This way, you can find the owner of a process.
Best,
Jun
|
|
|
|
|
Thank you - this solution worked great for me. I sincerely appreciate your willingness to answer my question.
Darryl Borden
Principal IT Analyst
dborden@eprod.com
|
|
|
|
|
You're welcome. Glad my advice was useful.
Best,
Jun
|
|
|
|
|
Ok I have got my page to display the data I need using a store procedure etc. What I need to know is, how do I create an input text form box (IE: Enter ID here with a submit button and pass that variable to the (ident = 1) below to make it (ident = textboxvariable). Any help would be appreciated thanks! =)
<%Dim ident
'select your product_id
ident = 1
Dim connection
Dim rs
'create the connection
connection = Server.CreateObject("adodb.connection")
'create the connection (here we used a DSN - use any standard connection
connection.open("Driver={SQL Server};Server=X;Database=trd;Uid=X;Pwd=X;")
'create the recordset
rs = Server.CreateObject("adodb.recordset")
'open the recordset, passing in the variable
'note that the variable product_id does not have to be name the same as in the stored procedure, it just needs to be the same data type.
rs.Open("Exec GETID " & ident, connection)
'display the recordset
Do Until rs.EOF
For Each ident In rs.Fields
Response.Write(ident.value & "<br />")
Next
Response.Write("<br />")
rs.MoveNext()
Loop
rs.close()
connection.close()%>
Jesse Myer
jessemyer06@aol.com
-- modified at 16:24 Tuesday 22nd August, 2006
|
|
|
|
|
Please don't cross post.
---
b { font-weight: normal; }
|
|
|
|
|
Hi All,
I have a business object, an "Asset", which takes it's data from a database table. Now, the "Asset" has a field called CompanyID, which is an int. This is great for the database, program and developer(me), but users might baulk at having to refer to numbers. Naturally, CompanyID is a relation to another table in the database.
So my question is: what's the best way of including a human friendly CompanyName in the Asset object? I could create a property which is filled in when the object is created from the db data, or I could have the object look up it's CompanyName whenever required or... What's the best thing to do?
Thanks,
Martin.
|
|
|
|
|
I'd expect the class to have a private ID and a public string for the name. Any object once read is disconnected from the database unless you re-read it, generally I think it's accepted that what you're looking at is the object at the moment you first requested it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
What I usually do is to join in the company table, so that I can fetch the company id and the company name in the query. Then I create a Company object from those, and store that object in the asset object.
To access the name of the company, I use: theAsset.Company.Name
---
b { font-weight: normal; }
|
|
|
|
|
You now have two choices lazy or earlier instantiation
Early:
public class Asset{
private Company company = null;
}
Have the DAL immediately load company
or lazy:
public class Asset{
private Int32? companyID = null;
private Company company = null;
public Company Company{
get{
if(this.company == null && this.companyID != null){
... Get it
}
return this.company;
}
}
}
in early your DAL will just fill the company
On two occasions I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question. - Charles Babbage
|
|
|
|
|
Hi there:
As you know we can compile a C Sharp program at DOS prompt like
csc MyProgram.cs
Where MyProgram.cs is the source code file.
Now i want to perform the same compilation through another C Sharp Program. Like i made a program named ShellExecution, which tries to compile another C Sharp Source Code File called "First.cs" lying in my c directory. The program runs fine without any exceptions; it opens the dos window and runs csc, but nothing happens and seems like the file name "First.cs" is not being passed to the csc.exe as a parameter. I have used the following code for executing the compilation process:
System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.FileName = "C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\CSC.exe";
process.StartInfo.Arguments = "C:\\First.cs";
process.StartInfo.UseShellExecute = true;
process.StartInfo.RedirectStandardOutput = false;
process.StartInfo.CreateNoWindow = false;
process.Start();
process.WaitForExit();
Please help me out!!!!
|
|
|
|
|
Why don't you take a look at the Microsoft.CSharp namespace? That's got some wrappers around the compiler.
As of how to accomplish this I wouldn't have a clue at the moment and I'm too lazy to google it
|
|
|
|
|
No, i dont have to use Microsoft.CSharp.
Its a requirement to use shell execution either through ShellExecute API or through the System.Diagnostics.Process namespace(as i have done in my code). Please anyone help me. I'm stuck.
|
|
|
|
|
You're code works fine on my machine (but had to change WINDOWS to WINNT).
As of how to accomplish this, have you ever tried Google?
|
|
|
|
|
I was wondering if there was a way to determine application dependencies at runtime..
I have several applications sharing a managed library registered in the GAC. When I need to update that library (not changing its version info, so that I dont have to recompile the programs to use the updated library), I need a way to see what open processes are using that library so I can kill them before the update.
If anyone has any suggestions, please let me know.
Thanks is advance,
Aaron
|
|
|
|