|
At the bottom of my previous message is a link that may help.
Dave
|
|
|
|
|
|
Saiyed Alam wrote: Sorry for that . But actually I'm in a bit hurry.
Aren't we all?
|
|
|
|
|
You forgot to mention that it's urgent in the message text - just using the subject for this is not enough.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Sorry for that . But actually I'm in a bit hurry. I need to scan pictures using scanner from my application and save them in my resource folder. But the problem is I have never worked with something scanner or printer or how to use them from C# application. Now it would be very help full for me if u tell me any way.
Thanking in Advance
Johnny
|
|
|
|
|
Saiyed Alam wrote: But actually I'm in a bit hurry
Actually, that doesn't matter because this is still a volunteer forum. Everyone who answers questions here does so simply because they like to help. But they have lives with other commitments. If you ask a good question you will get help, but only when those who volunteer have time.
|
|
|
|
|
I really don't think he's being urgent enough.
Maybe Christian's next article can be on "Getting Answers Fast - Communicating Urgency 101"
|
|
|
|
|
Quick!! hurry! hurry! panic! that's the best way to get you're code right...
"An eye for an eye only ends up making the whole world blind"
|
|
|
|
|
If you restate your question with a good subject line help is available. With a good subject line your question and the answers can be found by others who have similar problems in the future.
Rob
|
|
|
|
|
Is their any way to determine the user define type or string or List.
I know there are some methods that can be used to determine primitive types like IsPrimitive. Now String and user define objects are reference type thats where the problem is. I would like to use some this like this
if(objtype.IsPrimitive)
hashtable.add(obj.name, obj.value) //that i can do
else if(objtype.isString)
hashtable.add(obj.name, obj.value) // call a recursive method to get their property value and //fill the hashtable. How?
else if(objtype.isString)
somemethod(obj); //how?
else if(objtype.isString)
hashtable.add(obj.name, obj.value) //How?
else if(objtype.isString)
call a recursive method //How?
|
|
|
|
|
Hello
I want to hide a notify icon programmatically
I think that there is a value in the registry
which determines that.
and though, I know how to deal with Registry in C#
I still in lack of the registry key responsible for such information.
thanks.
|
|
|
|
|
LordCover,
Do you mean a notify icon you have created or one another program has created?, or just to hide ALL notify icons?
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
Hello guys
I want to hide one specific tray icon (by Name or ProcessID maybe)
I don't know
I googled and found a key in registry which stands for the
option Hide Inactive Icons in Taskbar properities.
but I want to handle each tray icon on its own.
thanks.
Note: I tried to use Sysinternals RegMon program to get the registry
key which stands for specific tray icon but I couldn't.
|
|
|
|
|
Lord Cover said:
but I want to handle each tray icon on its own.
I mean, I want to handle the options (Hide when inactive,
Always Show, Always Hide) for a specific tray icon.
I think there are no more clouds on my speech.
thanks.
|
|
|
|
|
|
thanks, I'll try that and reply to you later.
appreciate it.
|
|
|
|
|
You're welcome
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
Hi All,
I've been looking at this code and just cannot work out what the best solution is. My program runs this code:
private static void GetMachinesDirectoryList(bool ignoreC)
{
DriveInfo[] drives = DriveInfo.GetDrives();
foreach (DriveInfo drive in drives)
{
if (drive.DriveType == DriveType.Fixed && drive.IsReady == true)
{
ScanDir(DirectoryList, drive.ToString());
}
}
}
As you can see from the input parameter sometimes I don't want to scan the C:\ drive. What's the best way of doing this cleanly inside this method? I don't really want to start copying the DriveInfo[] to a string array as I'll then need to modify the drive.DriveType/Isready stuff and in so doing making this a much larger method.
Any thoughts would be great.
Cheers,
Jammer
Going where everyone here has gone before!
My Blog
|
|
|
|
|
Hmm ... replying to myself!
Is this possibly the neatest way?
public static void GetMachinesDirectoryList(bool ignoreC)
{
DriveInfo[] drives = DriveInfo.GetDrives();
foreach (DriveInfo drive in drives)
{
if (drive.DriveType == DriveType.Fixed && drive.IsReady == true)
{
if (drive.Name.StartsWith("C") && ignoreC == true)
{
}
else
{
ScanDir(drive.ToString());
}
}
}
}
Is this syntactically safe?
Jammer
Going where everyone here has gone before!
My Blog
|
|
|
|
|
Looks okay in my opinion.
I would just exchange
if (drive.Name.StartsWith("C") && ignoreC == true)
with
if (ignoreC == true && drive.Name.StartsWith("C"))
This way StartsWith will only be executed when ignoreC is set to true. This is logically a bit more precise, but shouldn't make any difference in performance (unless your program runs on a pentium 80 )
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
That makes a stack of sense, thanks for that Greeeg. Glad it makes sense too, I was trying all sorts of different things in order to achieve this simplicity yesterday, nothing beats 'no code' to get 'nothing' done tho eh!
Jammer
Going where everyone here has gone before!
My Blog
|
|
|
|
|
Hi All,
I have a datatable with some data :
ActivityNr ActivityStartTime ActivityDuration
001 20:30 00:30
002 20:30 00:40
003 20:40 00:30
004 20:50 00:30
005 20:55 00:30
As you can see, Activity 001 and 002 have the same StartTime(20:30), bud activity 002 has a longer Duration(40 minutes) then Activity 001(30 minutes).
Now i have to check all activities StartTimes and when they have the same StartTime(like 001 and 002), then i have to check the 'ActivtityDuration' of those Activities and delete the Activity with shorter duration from the datatable.
Assuming the datatable above, the end resulat most be:
ActivityNr ActivityStartTime ActivityDuration
002 20:30 00:40
003 20:40 00:30
004 20:50 00:30
005 20:55 00:30
001 is deleted because it had the same starttime as 002, bud a shorter duration.
Can anyone help me with this issue with some code ?
Thanx.
|
|
|
|
|
Pankach Udhas,
You need to create some DateTime objects and do some checks on them
Note: Its a better idea to use TryParse instead of Parse, i just used Parse because its faster to type out.
eg:
DateTime actOne = DateTime.Parse(actTwoDateTimeFromDataTable);
DateTime actTwo = DateTime.Parse(actTwoDateTimeFromDataTable);
if (actOne == actTwo )
{
DateTime actOneDur = DateTime.Parse(actOneDurationFromDataTable);
DateTime actTwoDur = DateTime.Parse(actTwoDurationFromDataTable);
if (actOneDur > actTwoDur)
{
}
else
{
}
}
Does that help?
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
I want to build a small utility using c# where I have to construct a hash table from any given object's properties . Say for example if a class is something like this
namespace my.project
{
using System.Runtime.Serialization;
using System.Collections.Generic;
[Serializable]
public class A: MySuper
{
public A()
{
}
private int _id;
private string _name;
private B _b;
public int ID
{
get { return _id; }
set { _id = value; }
}
public string Name
{
get { return _name; }
set { _name = value; }
}
public B B
{
get { return _b; }
set { _b = value; }
}
............
Now the hashtable should be like
Key Value
-- -------
id 12
name Robert
ABid 11
BC[0]id 12 //in case b has a list of c and c has a property id
BC[1]id 14
..........
...........
I was able to construct the hash map using reflection for any simple objects like A having only name and id. But in real word A might have B and B might have a List of C. So I guess I have get the property value using recursion and reflection.
Can any one suggest a better way to crate the above hash table maybe using serialization.
|
|
|
|
|
Serialization also uses Reflection internally to get the property information of a class, so you can just go the Reflection+Recursion route and everything will be fine.
This way you also don't have the limitations[^] of the standard .NET serialization classes.
modified 12-Sep-18 21:01pm.
|
|
|
|