|
hi
i want to know about my old file_size and new file_size to read its difference with the lest overhead
do anyone know any good way ?
Is there a way to get old size of file via FileSystemWatcher ?
|
|
|
|
|
Use the Systemm.IO.FileInfo class.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi,
I have a dictionary of items. I want to create a new Dictionary by taking items from it where each item meets a particular criterion. I figure that the ToDictionary extension method would suit my purpose, but for the life of me I cannot get it to compile.
<pre>
Dictionary<int, string> test = new Dictionary<int, string>{
{1 ,"a"},{2, "b"},{3 ,"c"},{4, "d"}
};
Dictionary<int, string> d = test.ToDictionary<int, string>(o => o.Value.CompareTo("d") == -1);
// compiler error on this line
//'System.Collections.Generic.Dictionary<int,string>' does not contain a definition for 'ToDictionary' and the best extension method overload //'System.Linq.Enumerable.ToDictionary<TSource,TKey>(System.Collections.Generic.IEnumerable<TSource>, System.Func<TSource,TKey>)' has some //invalid arguments
</pre>
The only thing that I could manage that came close to what I need is:
<pre>
List<KeyValuePair<int, string>> t1 = test
.Where(o => o.Value.CompareTo("d") == -1)
.ToList<KeyValuePair<int, string>>();
</pre>
I reckon I'm doing something really stupid but I can't see what it is. Can anyone help me out?
Thanks very much,
dlarkin77
|
|
|
|
|
This will work for you:
IDictionary<int,string> d = (
from t in test
where t.Value.CompareTo("d") == -1
select t).
ToDictionary(item => item.Key, item => item.Value);
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
That works lovely. Thank very much.
|
|
|
|
|
I want to transfer the data from excelsheet to data table,one by one entry
can any one help me to do so or send code for that in c#
|
|
|
|
|
abhijitjathar wrote: I want to transfer the data from excelsheet to data table
Does it mean you want to read excel sheet and display data in your App or you want to export the data to some other destintaion?
abhijitjathar wrote: one by one entry
What do you mean by this?
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
You can simply use ODBC to read data from excel to datatable.
|
|
|
|
|
Hi all.
Is exists way to binding cutsom type value to Control through databinding
Example
public class CLASSIFIED
{
public CLASSIFIED(double Val)
{
this._value = Val;
}
private double _value;
public static implicit operator CLASSIFIED(double Val)
{
return new CLASSIFIED(Val);
}
public static implicit operator double(CLASSIFIED CLASSIFIED)
{
return CLASSIFIED._value;
}
}
class SourceProvider
{
CLASSIFIED Index {get{...} set{...}}
}
...
control.DataBindings.Add("EditValue", _sourceProvider, "Index");
...
I know what i can do it through IFormatProvider interface like what : control.DataBindings.Add("EditValue", _sourceProvider, "Index", null, null, _myFormatProvider);
But what about other way, derive my custom type from AN INTERFACE what DataBindings.Add(...) recognize and format my custom type value automaticaly????
<br />
public class CLASSIFIED : ISomeInterfceWhatDataBindingRecoginze<br />
{<br />
....<br />
}<br />
}<br />
THANK!!!
|
|
|
|
|
This[^] might be a good place to start looking.
El'Cachubrey wrote: derive my custom type from AN INTERFACE
IDatatSource[^] perhaps?
But fortunately we have the nanny-state politicians who can step in to protect us poor stupid consumers, most of whom would not know a JVM from a frozen chicken. Bruce Pierson Because programming is an art, not a science. Marc Clifton I gave up when I couldn't spell "egg". Justine Allen
|
|
|
|
|
How do I initiate a queue of paired values?
|
|
|
|
|
Dictionary dictionary = new Dictionary();
or
KeyValuePair<string,string> myKVP = new KeyValuePair<string,string>();
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
modified on Friday, September 5, 2008 11:31 AM
|
|
|
|
|
Did you try Queue<KeyValuePair<string, string>> ?
|
|
|
|
|
Hi,
I'm a newbie in C#. I want to create a C# dll exporting some functions to be used from a thirdy party application. This application can call functions exported froma DLL but those functions have to be declared as __stdcall.
Is there a simple way to export functions froma C# dll as __stdcall (or in a way it works as __stdcall) ?
Thanks
|
|
|
|
|
Hi!
No, there is no way to export a __stdcall function from a C# assembly, because of several reasons. One of the reasons is that you can't have "functions" outside a class in C#, another one is that all C# methods rely on the CLR interpreting them.
You have to create a C++ DLL to do this.
Fortunately, you can quite easily access your C# classes from a mixed mode C++ DLL, so it should be possible to create some kind of wrapper to expose a call to a method written in C# for an unmanaged callee.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
The method of a wrapper c++ class was the first one I've thought and probably will be the final choice.
Anothre question ...
If a c# class method is declared as static, is it possible to export it in some way ?+
Thanks for your time
|
|
|
|
|
Please see this answer[^]
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hi all,
I am developing standalone application “To convert FOXPRO database to MS Access Database” I started to develop this application Using dot net Frame Work. I am not getting any help in net, any body knows about this please help me.
Thanks & Regards
-Pavani
|
|
|
|
|
hi
You have to give more info on what you want. You want to Convert FOXPRO to Access? then there are tools to help you Convert. now where does .NET Fit in here , do you want your Application to point to Access after you are done ?, please give more info. please see this for converting from FOXPRO to Access
http://dbconvert.com/index.php?DB=1&adv=access&gclid=CK-Vm4SFxJUCFQWR1Qodm062iQ[^]
http://shareme.com/showall/Foxpro--To-Ms-Access.html[^]
Hope this Helps
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
In my windows form I have a tabcontrol with 3 tabpages. How can I add shotcut key so that while the tabcontrol is loaded I can visit each tab page through the shortcut key
Thanks & Regards
|
|
|
|
|
Handle the KeyPress Event[^] of the form.
But fortunately we have the nanny-state politicians who can step in to protect us poor stupid consumers, most of whom would not know a JVM from a frozen chicken. Bruce Pierson Because programming is an art, not a science. Marc Clifton I gave up when I couldn't spell "egg". Justine Allen
|
|
|
|
|
You can of course handle the events manually based on what the other CP member posted. One option that works with almost everything (not sure about tab pages), is to include an underscore before the appropriate letter in the tabpage letter. When the user presses Alt the underscores will show in the application and the appropriate letter can be sent with the alt statement.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
hi,
i want to compare 2 XML files , which 1 will be existing and 2nd one will be the new version. what i want is compare these 2 and then retain existing values but update if there is anything new. or remove if there is anything removed in the new version of the xml file. i tried using xmldiffpatch tool but i couldnt achive this. is there any way to resolve this.
im deaf to the word no
|
|
|
|
|
Do you want the files to be identical? If so, why don't you just make a copy of the second file, with the same name of the first, regardless of any comparison?
|
|
|
|
|
nope i dont want them to be identical.. i just want to keep the existing values of the old xml, and include if there are any new values in the new xml.
im deaf to the word no
|
|
|
|