|
Do you have any idea how to create IE plugin which will save to log file time of page load? This plugin should report start time (when user clicks go button) and end time (when page is completely loaded).
I prefer .net framework examples, but if you have other ideas, please fell free to post them
|
|
|
|
|
This has already been posted to Q&A; please do not post in multiple forums.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
So I've been reading along in a delightful book, Programming Microsoft SQL Server 2008, for months now, and decided to try out a few of the samples in the text. I fired up VS2010, then tried to add references to the two required assemblies - Microsoft.SqlServer.Smo and Microsoft.SqlServer.SmoExtended. They don't friggin' exist! The only thing visible in the Add References box is Microsoft.SqlServer.Server, so I figured they must have consolidated things a bit from .Net 3.5 to .Net 4.0. No such luck.
So then I tried changing the project from ver 4.0 to 3.5. I'm told I have to close the solution, then re-open it for the change to take effect. That makes sense, so I follow the instructions like a good sheep. When I reopen the solution, I'm presented with the error, "Warning 1 The referenced component 'Microsoft.CSharp' could not be found."
Where did it go? It's not even in the list to re-add it to the solution! All the other language references are there, but CSharp is now missing. Do I now have to re-install VS2010 to get C# functionality back again? Do I have to go back to VS2008 in order to talk to a database using SMO?
I really should be doing homework, but I needed a break and thought this would be a fun, relaxing evening of exploration. Instead, it's a nightmare...
Will Rogers never met me.
|
|
|
|
|
Microsoft.CSharp is a new reference in Framework 4.0.
If you are using something from this dll, then you will need to remove this code (or find a workaround) when you downgrade.
|
|
|
|
|
Oops. Silly me, I have no idea how to remove a reference once I've added it. Can I simply delete it from the project References folder? Like a lot of beginners, I suppose, I usually just keep adding references and using statements until the error messages go away; it never occurs to me to delete them once I get the project working.
Will Rogers never met me.
|
|
|
|
|
If you look at the references listed in your project explorer and find the Microsoft.CSharp.dll reference, simply right click and delete or remove it and the reference should be gone. If you have any code inside your app trying to use anything from the CSharp.dll you must remove it and try another method as was suggested. Or you can change your app back to .Net 4.0 and everything should be okay again. Unless you are making an app that is designed only to work with XP, there really is no reason to change back to 3.5 or another previous version of the .Net Framework. XP users can simply download the .Net framework 4.0 for free to use your app.
|
|
|
|
|
XP users on SP3 or higher can do. I have an XP machine at home and it won't install .Net 4 (or even 3.5, I think) and I don't feel like downloading however many megabytes of updates to move it onto XP SP3, either.
Is 4.0 included as standard with Windows 7? It certainly wouldn't have been with Vista, and making people download a new version of the Framework to use your app is likely to turn a few people off.
|
|
|
|
|
.Net 4.0 is native to Windows 7, and it's available for download. I usually have my setup.exe determine if .Net 4.0 is installed on the operating system in which my app is being installed too first. If not it will automatically install it for them. Most setup.exe applications that I know of incorporate this now.
|
|
|
|
|
It may be 'available for download' but it's a damn big download (200MB? something like that) and unless someone has a fast connection or really wants your software they'll give up when they see that.
|
|
|
|
|
Typically Bob, this is already downloaded and stored on the CD or DVD in a folder with the rest of the setup application to be used if necessary. During the setup processes it is installed if required. If the user decides to download the application from the internet they should be aware of the possibility other prerequisite software may need to be installed as well and downloaded.
|
|
|
|
|
Now that you have thoroughly pissed of the ide it has arbitrarily removed c#, you must now continue to code using VB. If you continue to irritate the ide you will be retrograded to VB6.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thankfully, I've never thrown out my VB6 floppy disks, so it may just be possible to recover from my terrible error.
Will Rogers never met me.
|
|
|
|
|
The assemblies are found in C:\Program Files\Microsoft SQL Server\100\SDK\Assemblies. When you add a reference, go to the "Browse" tab, and select them from that place.
|
|
|
|
|
which license you are having for your VS2010 ?All libraries are not supplies with express edition.You need to get an ultimate or professional license for all the libraries and features.
|
|
|
|
|
VS2010 Professional is what it says, but it's the Academic license. Surely Microsoft isn't cheating students!
Will Rogers never met me.
|
|
|
|
|
I don't even know where it came from or what it's good for. I dereference it.
|
|
|
|
|
Greeting Gurus,
I have been battling for a while with getting some of the properties of running processes and was hoping for a little assistance.
If I build
Process[] processlist = Process.GetProcesses();
foreach(Process p in processlist)
{
Console.WriteLine("Process: {0} ID: {1}", p.ProcessName, p.Id);
}
Console.ReadLine();
then I get a list of all processes, but if I try
Process[] processlist = Process.GetProcesses();
foreach(Process p in processlist)
{
Console.WriteLine("P: {0} ID: {1} FN: {2} ST: {3}", p.ProcessName, p.Id, p.MainModule.FileName, p.StartTime);
}
Console.ReadLine(); I get a Win32Exception unhandled error when the enumeration hits the "System" process PID 4. The error is:-
System.ComponentModel.Win32Exception was unhandled
Message="Unable to enumerate the process modules."
Source="System"
ErrorCode=-2147467259
NativeErrorCode=-2147467259
but I can't find any references as to what to do about it.
I would like to keep it in the list of processes if possible, i.e. not just skip it in order to continue the enumeration.
Could someone advise please?
|
|
|
|
|
You need to filter out the "System" and "Idle" processes, as you won't have permission to access their modulenames. Try something like this:-
Process[] processlist = Process.GetProcesses();
foreach (Process p in processlist)
{
if (p.ProcessName == "System" || p.ProcessName == "Idle")
{
textBox1.Text += string.Format("P: {0} ID: {1}\n", p.ProcessName, p.Id);
}
else
{
textBox1.Text += string.Format("P: {0} ID: {1} FN: {2} ST: {3}\n", p.ProcessName, p.Id, p.MainModule.FileName, p.StartTime);
}
}
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
Hi Wayne,
Thanks for that. Interesting though that if I use WMI as a "proxy" running...
ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_Process");
foreach (ManagementObject queryObj in searcher.Get())
{
string[] argList = new string[] { string.Empty, string.Empty };
int returnVal = Convert.ToInt32(queryObj.InvokeMethod("GetOwner", argList));
if (returnVal == 0)
{
string owner = argList[1] + "\\" + argList[0];
Console.WriteLine("Name: {0} Owner: {1}", queryObj["Name"], owner);
}
}
It tells me "Name: System Owner: NT AUTHORITY\SYSTEM" and then goes on to list a whole bunch of other NT AUTHORITY\SYSTEM processes. Interesting too that "Idle" doesn't show up in the list.
What are your thoughts?
|
|
|
|
|
I would guess that accessing the Process.MainModule property for that process is throwing the exception, something that should be checked for in your code (accessing that property can throw three possible exceptions).
Mark Salsbery
|
|
|
|
|
Hello everyone,
Do you know how to simulate in C#, a VB6 Activex EXE Standalone application which exposes a com visible object (IDispatch wrapper class) already instanced in the 'activex exe like' c# application? The clients accessing it via creatobject / getobject will always get a reference on this object.
This does not seem to be so straight forward as I experimented in vb.net. Is it related to .net interop ?
If I understand well, the best way will be to expose a .NET Remoting object (application life time) then creating a COM interop class library which will be used like a tunnel between the two communication solutions. Is it the only solution ?
Any inputs you could share for this are really welcome ?
Thank you so much in advance.
|
|
|
|
|
|
Meanwhile I found a hack, not the real solution I want.
I created my own TabControl , and replaced the TabPages property, such that my own TabPages property will be linked to my editor:
public class MyTabControl : TabControl
{
public MyTabControl() : base() { }
[Editor(typeof(MyTabPageCollectionEditor), typeof(System.Drawing.Design.UITypeEditor))]
public new TabPageCollection TabPages
{
get { return base.TabPages; }
}
}
But that means that I'd have to replace all TabControl s with MyTabControl ...
I'd really prefer a solution like the one described at StackOverflow.
Perhaps you can provide some further ideas.
|
|
|
|
|
Hi all
When creating COM dll from C# i get TLB file.
All enums in the file get a prefix of the enum name
is therea way to remove the prefix?
public enum OPTIONS
{
Zoom = -1,
FitWindow,
FitWidth,
FitHeight,
Actual
}
OPTIONS
{
OPTIONS_Zoom = -1,
OPTIONS_FitWindow = 0,
OPTIONS_FitWidth = 1,
OPTIONS_FitHeight = 2,
OPTIONS_Actual = 3
};
Have a nice Day
|
|
|
|
|
There is, but you're not going to be keen on how much work it is. Anyway, if you want to do this you need to follow the steps in this[^] blog.
|
|
|
|