|
.NET Remoting does not read the .config file automatically. To do, get the path to the .config file using AppDomain.CurrentDomain.SetupInformation.ConfigurationFile to get the path programmatically. Then call RemotingConfiguration.Configure with the return value of that property.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
I'd like to write a stealth windows application that logs what files a user downloads. I would like to use the application to perform trend analysis, what files(jpegs, gifs or mpegs etc) a user downloads the most. Using C# I would like to know the logic behind it!
eg. User clicks on a button or href to download file.
My app logs user downloading file from site
Any ideas will be much appreciate it..!
|
|
|
|
|
You would essentially be writting a firewall. A low-level application that the .NET Framework is NOT suited for. You'll be P/Invoking ALOT of Win32 API calls yourself.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
You could also write a Browser Helpfer Object (BHO). It's an ActiveX control that can sink the connection points in Internet Explorer, similar to how IE toolbars and desk bands work (though no GUI is required).
See Browser Helper Objects: The Browser the Way You Want It[^] for more information.
While you could create a BHO using C# and exposing a CCW (COM-Callable Wrapper), it would be pretty slow with the extra marshaling overhead. I suggest writing one in C/C++ if you know it - it's really not too hard.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
BHO's will work only with IE and Windows Explorer. They will not work with Netscape Navigator, or Mozilla, ...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
this is control listview
1. I also alternate colors of rows
between gray and white. Now at Control Listview
2. I want change Color header at Control Listview
but ...i can not it
Please help me
Thank you
|
|
|
|
|
please write little clear.
Sreejith S S Nair
|
|
|
|
|
The ListView control doesn't natively support alternating colors for ListViewItem 's or changing the Header Background color. You would have to ownerdraw the ListView control yourself to get that kind of functionality.
Check into articles on CodeProject here[^] and here[^]. Also on CodeGuru here[^].
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Does anyone know how I can get my property that is a member of my Component, so show up in the Dynamic Properties section of the property editor? I want to bind it to the app.config file, and I expect it to appear in the designer so I can bind easily through the IDE... (did I explain that clear enough?)
Thanks!
~Steve
|
|
|
|
|
The following attribute will place FirstName within the Dynamic Properties and then the Advanced section.
private string _name;
[Category("(DynamicProperties)")]
public string FirstName
{
get{return _name;}
set{_name = value;}
}
- Nick Parker My Blog | My Articles
|
|
|
|
|
Thanks!! "CategoryAttribute" was one I wasn't familiar with...
~Steve
|
|
|
|
|
You should take a look at the classes in the System.ComponentModel namespace for more helpful design-time attributes and more. A good section to read if you're new to design-time extensibility is Enchancing Design-Time Support[^] in the .NET Framework SDK documentation.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Great stuff! Thanks Health and Nick. Yes, I'm new to .NET entirely, and am very impressed with what I'm seeing so far. Thanks for the tips and pointers...
~Steve
|
|
|
|
|
I have seen a document somewhere I can design the window form shape to be circular, instead of traditional rectangle shape. Can anyone help? I'm thinking of making this round shape for about box. Something unique.
That's in Visual.net C# language. Thanks!
Ron Boucher
|
|
|
|
|
This uses a clipping region that works with all Windows. See the Graphics.Clip property in the .NET Framework SDK.
One Windows 2000 and newer, you can also use alpha blending and transparent colors. For example, you can set the BackColor of many controls to Color.Transparent . You can also use an image with alpha blending in many cases. Again, though, this is only supported on Windows 2000 and newer NT-based OSes.
Another thing you should check out is the RegionMaster Controls[^] on WindowsForms.net. This is written by a Microsoftie, though not supported officially by Microsoft. It was featured in MSDN TV some time back and is very nice. This aleviates the work for you.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
I basically create a dataset and read in a schema file into the dataset. Then when done saving a record to the dataset I save to file as diffgram. When I come back in and recreate the dataset I need to find a particular record that is in the dataset. I do this with the following
code:
<code>
private void FindTodaysDSRec()
{
string sDate, sRecFind;
DateTime dDate = DateTime.Now;
dDate = dDate.AddDays(-1);
// sDate = dDate.ToString("d", DateTimeFormatInfo.InvariantInfo);
sDate = @"12/1/2003";
sRecFind = "MR_Date = " + sDate ;
nRow2 = dsDiff.Tables["MN"].Select(sRecFind);
}
</code>
The record I am looking for exists in dataset but I get a nullrefexception on the select statement.
Here is what the MR_Date is represented as in the schema file:
<code>
<xs:element name="MR_Date" type="xs:dateTime" msdata:AutoIncrement="false" />
</code>
Here is what is in the diffgram:
<b><small>
<Table diffgr:id="Table1" msdata:rowOrder="0"><MR_ID>110</MR_ID><MR_Date>2003-12-01T00:00:00.0000000-05:00<MR_Date>
</small></b>
The sDate statement in the select looks like this:
sDate = "MR_Date = 12/1/2003"
So what am I doing wrong with my select clause in code above?
Thanks,
JJ
|
|
|
|
|
There is no table called "MN", so your dsDiff.Tables["MN"] is returning null . This is the kind of check you should make before calling methods on an object when you're not sure if you'll get an instance or not.
When you read-in your DiffGram, make sure you read the XML Schema first (or just use a typed DataSet ) and use ReadXml("somefile.xml", XmlReadMode.DiffGram) since the file is formatted differently than how a DataSet is serialized normally.
Also, make sure you read the schema before writing your DiffGram. I noticed that the DiffGram table ID is "Table1". The same schema must also be used for both WriteXml and ReadXml .
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi Heath,
I did what you said, read in the schema first then the xml diffgram file. This goes smoothly but as soon as I hit new row on dataset I get the nullrefexception. I named the table statement as "Table1" too. Here's my schema file and xml file maybe u can see something I don't:
<code>
<b>XML Diff File</b>
<diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
<Table1><Table diffgr:id="Table1" msdata:rowOrder="0">
<MR_ID>110</MR_ID>
<MR_Date>2003-12-01T00:00:00.0000000-05:00</MR_Date>
<Coal_Feeder_Tot>690058</Coal_Feeder_Tot>
<Coal_Silo_Level_Prct>73</Coal_Silo_Level_Prct>
<Coal_Barn_Inv_Prct>25</Coal_Barn_Inv_Prct>
<Limestone_Feed_Total>171316</Limestone_Feed_Total>
<LS_Silo_Level_Prct>70</LS_Silo_Level_Prct>
<Ammonia_Totalizer>388974</Ammonia_Totalizer>
<Prop_to_Burn_Totalizer>14629</Prop_to_Burn_Totalizer>
<TwentyFourHr_SO2_Reduct>92</TwentyFourHr_SO2_Reduct>
<Limestone_Received>40800.37</Limestone_Received>
<Ammonia_Received>0</Ammonia_Received>
<Prop_Received>9004</Prop_Received>
<Est_hours_Dry_Oper_Hours>0</Est_hours_Dry_Oper_Hours>
<LAB_Sulfur_Content_Prct>2.13</LAB_Sulfur_Content_Prct>
<LAB_High_Heat_Val>6833</LAB_High_Heat_Val>
<CEMS_SO2_Daily_Avg>549</CEMS_SO2_Daily_Avg>
<Raw_Water_Pump_Meter>15795967</Raw_Water_Pump_Meter>
<Reservoir_Level>1844</Reservoir_Level>
<Date_Rec_Added>2003-12-08T08:47:15.0000000-05:00</Date_Rec_Added>
</Table>
</Table1>
</diffgr:diffgram>
<b>Schema</b>
<?xml version="1.0" standalone="yes"?>
<xs:schema id="Table1" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="Table1" msdata:IsDataSet="true">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="Table">
<xs:complexType>
<xs:sequence>
<xs:element name="MR_ID" type="xs:long" minOccurs="0" />
<xs:element name="MR_Date" type="xs:dateTime" minOccurs="0" />
<xs:element name="Coal_Feeder_Tot" type="xs:decimal" minOccurs="0" />
<xs:element name="Coal_Silo_Level_Prct" type="xs:decimal" minOccurs="0" />
<xs:element name="Coal_Barn_Inv_Prct" type="xs:decimal" minOccurs="0" />
<xs:element name="Limestone_Feed_Total" type="xs:decimal" minOccurs="0" />
<xs:element name="LS_Silo_Level_Prct" type="xs:decimal" minOccurs="0" />
<xs:element name="Ammonia_Totalizer" type="xs:decimal" minOccurs="0" />
<xs:element name="Prop_to_Burn_Totalizer" type="xs:decimal" minOccurs="0" />
<xs:element name="TwentyFourHr_SO2_Reduct" type="xs:decimal" minOccurs="0" />
<xs:element name="Limestone_Received" type="xs:decimal" minOccurs="0" />
<xs:element name="Ammonia_Received" type="xs:decimal" minOccurs="0" />
<xs:element name="Prop_Received" type="xs:decimal" minOccurs="0" />
<xs:element name="Est_hours_Dry_Oper_Hours" type="xs:int" minOccurs="0" />
<xs:element name="Est_hours_Dry_Oper_Mins" type="xs:int" minOccurs="0" />
<xs:element name="LAB_Sulfur_Content_Prct" type="xs:decimal" minOccurs="0" />
<xs:element name="LAB_High_Heat_Val" type="xs:decimal" minOccurs="0" />
<xs:element name="CEMS_SO2_Daily_Avg" type="xs:int" minOccurs="0" />
<xs:element name="SO2_Daily" type="xs:decimal" minOccurs="0" />
<xs:element name="Raw_Water_Pump_Meter" type="xs:decimal" minOccurs="0" />
<xs:element name="Reservoir_Level" type="xs:decimal" minOccurs="0" />
<xs:element name="Comments" type="xs:string" minOccurs="0" />
<xs:element name="Date_Rec_Added" type="xs:dateTime" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
</code>
This is the line it errors on :
nRow = dsDiff.Tables["Table1"].NewRow();
Thanks,
JJ
|
|
|
|
|
No, actually you called your DataSet "Table1", which I noticed in your previous post. Your DataTable is named "Table". The DataSet element is the root node of your DataSet , the child nodes is/are the DataTable (s), and their children are the fields in a row of the table.
So, dsDiff.Tables["Table"].NewRow(); would work, but you really should name your DataSet and DataTable appropriately according to your needs.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi all,
This is driving me crazy. I have a double variable that has taken a value very close to zero. I try to put the value on the console as
double noiseMean;
Console.WriteLine(noiseMean);
It displays the value in the scientific notation. How can I tell it to display it as the decimal notation. I tried using noiseMean.ToString(), but it always frmats it in the same notation.
Thanks,
Pankaj
Without struggle, there is no progress
|
|
|
|
|
|
Hi,
Thanks for the reply. However, it still throws out the variable in the scientific notation.
Pankaj
Without struggle, there is no progress
|
|
|
|
|
Hi,
You pointed me in the right direction though. Just saw the section on format specifiers. "d" is for integral datatypes only. Using "f15", basically fixed point with 15 as the precision specifier did the trick.
Thanks,
Pankaj
Without struggle, there is no progress
|
|
|
|
|
The format specifier "d" or "D" will always throw a FormatException for certain primatives like double .
Instead, use Console.WriteLine("{0:f}", 0.0000000001d); , for example. This defaults to two decimal places. If you want more, specify the precision after "f", like so:
Console.WriteLine("{0:f8}", 0.0000000001d); The result here will be the same, of course: 0. You can change the precision how you see fit, though.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Woops, you got me on that one. I blame it on only having Visual Studio 6.0 in front of me as I typed my response, err, if you want to call that an excuse.
- Nick Parker My Blog | My Articles
|
|
|
|