|
Use System.IO.Path.GetExtension(filename) , and you'll get ".zip". There are also methods for getting the filename, or the directory.
"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 am using asyncrouns socket and the application connects it to another application. but the requirement is, if my apllication gets discionnected due the failure of previous aaplication when the other application starts up , my application should connect the application as soon as the user clicks on the dialog which is shown at the time of disconnection.
but i am encountering this exception:
the undo operation encountered a context that is different form what was applied in corresponding set operation. the possible cause is that a context was set on the thread and not reverted (undone)
can any one help it
|
|
|
|
|
|
hmmm..looks like a Tongue Twister problem
"Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)
|
|
|
|
|
I've got an interesting issue here, where I am not sure how to tackle it. So if you have some input for me, it's appreciated.
What is the issue?
I am working on a new component, which calculates stuff and does some other things. It's not that important what it does for this issue. This new component is programmed in C# on .net 3.5.
This new component is meant to replace an old component in the currently widely deployed application. This current application is programmed in VB6 and is an application with a number of COM+ components.
One of those components is the DataManager which handles all access/traffic to and from the database, this is a COM+ component.
Now, this is where I'm having some difficulties. This datamanager expects 3 parameters: connectionstring, function to be called and last but not least, a propertybag to put the results in. My new component has to use the datamanager for data retrieval.
So here I am, in .net I don't have a propertybag, and the methods are called like:
_werknemerBO.FetchData(_connectionString, "WnWithWndnstvb", ref data); // data is an empty propertybag, WnWithWndnstvb is the method to be called.
I'm no VB6 coder, I can only read it. But is there a robust solution how I can get this solved elegantly? I can't change the datamanager-code, since that component is used by other parts of the application. In .net I have the free hand to get it working.
Any suggestions plz, thanks.
The consumer isn't a moron; she is your wife.
|
|
|
|
|
You could try looking at this[^] article, to see if it gets you at least started.
I found this by googling 'propertybag'. You could try that, if the article above doesn't help you. It just seemed closest of the first page to your question.
Good luck!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hello,
I want to ask if anybody know how to render (show) image really fast. Because if I override OnPaint in user control and I use GDI+ function drawImage it is really slow for bigger images (2000px x 1500px) especially on my EEE notebook, and redrawing image when main menu disappear is terrible slow.
|
|
|
|
|
Split the large image up into smaller images, and only draw the ones that overlap the invalidated region when the menu disappears
|
|
|
|
|
|
Hi,
here are some ideas:
- if the destination's resolution is different from the image one, your image is getting rescaled; you could cache the image at the right size, that would speed up the repaints.
Example: Bitmap bm2=new Bitmap(bm1, destSize);
- if the image has to come from disk and is compressed (e.g. JPEG) it may be worthwhile to keep an uncompressed copy (say a BMP); the file would be larger, painting it could be faster.
- even without chopping it up into subimages, you could just repaint the part that needs repainting by using one of the more complex overloads of DrawImage().
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
I wanna include the images in my windows form where am doing globalization. Normal Label,textbox values are working perfectly but am clueless abt including image
|
|
|
|
|
Does this mean that you require different images for each language?
It is not really clear from your OP.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I have the following situation:
- A Timer tick event handler that puts some data on a queue
and sets a manualresetevent.
- A background thread (an infinite loop) that sends the data in the queue to some devices.
-> if the queue is empty, the thread uses manualresetevent.Reset()
to block this thread on manualresetevent.waitone()
-> if the queue is getting to long, the older data is considered obsolete
and just thrown away.
Using the multimediatimer makes the timing more accurate,
but if the background thread is blocked and I use manualresetevent.set().
how long wil it take the background thread to continue?
15-20ms? Is there a way to improve response time?
15-20ms is not a big issue, but faster is always better
(note: the background thread is just a regular thread, not a backgroundworker)
|
|
|
|
|
You should be seeing a delay in the order of 10x10-6s because you are incurring a context switch. This is roughly how long the windows takes to schedule a thread and resume running it on a CPU. If you are seeing 10x10-3s, this is a quantum and will occur if you are running too many threads for the number of cores in your machine.
The only way to speed this up is not to put your thread in a wait state in the first place. If the delay is really too long, you can try spinning the thread instead of using a wait. This of course has one big drawback: you will be using one core all the time, most of it wasted.
Nick
----------------------------------
Be excellent to each other
|
|
|
|
|
Hi.
I have a string ( e.g "Regex" )
Now I want to find the equal class with its name , if exist (programmatic).
Actually, I'm going to create a simple colorize code editor !
Could you guide me ?
Thanks a lot.
|
|
|
|
|
well.... number of ways to proceed....
here one...
1.Set the name of the class exactly as you want (Note: this will be the key)
2.Get the types available in the executing assembly.
by
Assembly myAssembly = Assembly.GetExecutingAssembly();
3.Then iterate on each type and compare it with your string and do whatever...
like
foreach (Type mytype in myAssembly.GetTypes())
{
if(mystring == type.Name)
{
}
}
if yo have 10 class types in your assembly all of them will be listed and you can use it further.
Have a Happy Coding.....
|
|
|
|
|
King Julien wrote: 1.Set the name of the class exactly as you want (Note: this will be the key)
It means , I have to set the name in a string manually ?
Sorry , I'm novice in Reflection
|
|
|
|
|
Not actually.
You can have any name for the class as you want. And you can check and compare any string with the available types(i.e. the classes)
for e.g,
if your string is blue, then if a type (class) with the same name is available i.e. A class called blue then the condition is validated. Thats why i meant that the string is the keyword.
Note Case sensitive issues can be solved by parsing.)
Have a Happy Coding.....
|
|
|
|
|
Hello,
I'm making a game called CursorDancing.
It's very similar to Dance Dance Revolution.
Now i've got a few problems.
1: How do i get the Top Arrows to light up?? You know the ones that stay in place.
2: How can i link the Top Arrows to my arrows keys on my keyboard???
I'm not using GDI or XMA
Thank you very much
Love & Peace Daphne
|
|
|
|
|
These are fairly simple things to do - I'm guessing you're learning C#, but making a game isn't necessarily the way to learn.
Anyway, the answers
1) Draw a different image when you want them to light up
2) Put in a keyboard handler
|
|
|
|
|
this[^] will help
I misunderstood
To light up change the picture or draw similar transparent color over it by using Alpha of Color
and you can use KeyDown and KeyUp event
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
I had small application of BHO using c# through which I had pass other PDF file in palce of a original pdf file on
browser (i.e., during navigation between web pages). I had been doing all these with the help of WebBrowser
events following: http://msdn.microsoft.com/en-us/library/aa768283(VS.85).aspx
If I try to navigate the PDF file on my desktop in place of a pdf file on browser, as many events get fired
continuously, the replaced file is blinking continously. I don't want this phenomenon.
So I choose Property change event. In this also, i'm unable to get url names in which pdf file is opened.
How can I do this?
Is there any other way to achieve this using BHO?
Is there any other events through which I can get this?
|
|
|
|
|
I'm executing following program, which is having two interfaces with same function name. So can anybody let me know actually which one or which interface's function is being executed or called
interface intf1
{
void get();
}
interface intf2
{
void get();
}
class A : intf1,intf2
{
public void get()
{
Console.WriteLine("Hello");
}
}
static void Main(string[] args)
{
A e = new A();
e.get();
Console.ReadLine();
}
|
|
|
|
|
While implementing interfaces, you just state that the functions you put into your interface are accessible in the class which implements the interfaces.
So if you have this interface:
interface intf1
{
void get(int i);
}
interface intf2
{
void get(boolean b);
}
Your class will look like this:
class A : intf1,intf2
{
public void get(int i)
{
Console.WriteLine("Number: " + i);
}
public void get(boolean b)
{
Console.WriteLine("Bool: " + b);
}
}
|
|
|
|
|
You are executing functionality of the object and not interface.Interface is abstract, it does not have any implemntation, it is just a way of specifying a contract satisfied by the object.
|
|
|
|