|
a jpg picture object inserted into crystal report through Right-Clicked -> Insert -> Picture...
now, the picture inserted must be change to the file of c:\myPic.jpg or others by code dymanically.
How to do it?
thanks.
|
|
|
|
|
Hi! Dear,
I need to compare two files' content in my multithread C# code project.So,which class and what method should I use?
Thanks!
momer
|
|
|
|
|
You can do something like this:
using System.IO;
FileStream s1 = File.Open("C:\\whatever.txt"); // Opening a file.
FileStream s2 = File.Open("C:\\whatever2.txt");
BinaryReader r1 = new BinaryReader(s1); // Easier reading.
BinaryReader r2 = new BinaryReader(s2);
if (s1.Length != s2.Length)
{
// Different sized files.
}
while (s1.Length != s1.Position)
{
if (r1.ReadByte() != r2.ReadByte())
{
// Difference found.
}
}
|
|
|
|
|
Hi!,EssOEss,
Thank you very much! It really works.
May god bless you and your families!
momer
|
|
|
|
|
Many Controls/Class have their own EventHandle , Such as Button.Click ,...
i want to write my own EventHandle for my own class.
but i dont understand it too much. The samples on MSDN are
a bit difficult for me.
are there some article concerning on this issue ?
|
|
|
|
|
It's is pretty easy to go for Custom Events( Own Event) in .NET. You need to cover few other techinics,if you want to go for this sort Custom Events and Event Handlers. You need to declare a deletegate for the event. Then need to encapsulate your code(Own Event handler code) into that delegate. Once you finish this, then you can declare an event of your delegate type. Then try to use your event where ever you want.
I seen lot of same question in CP discussion. And i know this much information is not sufficient for you people. Anyhow wait, in a couple of days i will write a nice article on Custom Events and Handling .
For the time being you can refer this articles.
Custom Events
Sreejith Nair
[ My Articles ]
|
|
|
|
|
There is an entire caregory on this topic. See "Delegates and Events".
|
|
|
|
|
|
Dear .NET Developers,
I need to do a report like Master Detail.For Example two reports are there test and test1.If I click the report test,test1 report should come.Is it possible to do like this.Help me.
radha
|
|
|
|
|
Although I don't know exactly what you are doing, I would put my details in a group and hide them but allow drill down. When the user drills down that section will display. If you are determined to make the drill down a separate report just embed the subreport in the hidden section and link it.
Let me know if you need further explanation.
ed
The absence of evidence is not evidence of absence.
|
|
|
|
|
Actually I need that one.Can you please tell me how to do
|
|
|
|
|
I have a control that expands when pressed. My question is how do I manange/move the other controls so nothing overlaps.
Also, how can I add a checkbox to a label before Text label. When I add it to label.Controls I just see the checkbox.
And last thing, in my class, I have label.autosize = false;
but when I add that control to the form, the VS 2005 sets the autosize property to true.
Thanks
|
|
|
|
|
There is no built in support for laying out controls. What you can do is derive from ContainerControl and catch the resize event for all the contained controls. When resize occurs you determine if you need to perform layout. If you do need to perform layout u can do something like this (psuedo-code):
int currentx;
int currenty;
foreach(control c in this.controls)
{
c.location = new point(currentx, currenty);
increment currentx and current y
}
>> how can i add a checkbox to a label
Whats the point of doing that?
|
|
|
|
|
|
I have a need to be able to automatically launch a VPN connection to a customer's site to allow me to download a file and process it. I would like to use C# to build a task or service to perform this. Does anyone have any examples of automatically launching the VPN connection and disconnecting the connection after the file is processed?
Thanks
|
|
|
|
|
You can P/Invoke the WNet APIs like WNetConnectionDialog (to prompt) or P/Invoke WinInet APIs like InternetAttemptConnect , all of which are documented in the MSDN Library Online[^].
We've also discussed this before on the forum. I encourage you to click "Search comments" above and try searching for keywords like "WinInet".
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
I am trying to develop an IE plugin that
a- Show its Icon on the toolbar
b- Interact with IE and record every site the user goes to.
Any ideas
P.S. Dont be concerned, im not interested in writing spyware. Im more concerned with getting the IE COM model to interact with C# and logging every http request is one way i know that its working.
|
|
|
|
|
Take a look at some of the articles on the following search: http://www.codeproject.com/info/search.asp?cats=3&cats=5&searchkw=band[^].
You don't really need a toolbar button, though. You can accomplish this most easliy using a native COM server called a Browser Helper Object. In fact, an article on MSDN even does what you want: each time an HTML resources is downloaded it fills a little tool window with the content (using the DOM to a degree). Read Browser Helper Objects: The Browser the Way You Want It[^].
You should also read Creating Custom Explorer Bars, Tool Bands, and Desk Bands[^]. Note that because these all require COM clients and servers that use defined interfaces, it's often easier to write your add-ins in native (unmanaged) C++; otherwise, you have to properly declare your COM interfaces in C#, declare the necessary structs correctly, define constants, and sometimes P/Invoke native functions to get your managed code to work - quite a bit of overhead.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Thanks..... working on it rite now....
|
|
|
|
|
I'm trying to resolve this error (pointed at first case 1: under Id)
Control cannot fall through from one case label 'case 1:' to another.
Control cannot fall through from one case label 'case 3:' to another.
Sample Code:
public string UniqueStrings(string ck1, string ck2, int Id)
{
switch (Id)
{
case 0:
{
switch(Convert.ToInt64(ck1, 16))
{
case 0x00: return "zero-zero";
case 0x01: return "zero-one";
case 0x02: return "zero-two";
case 0x03: return "zero-three";
case 0x04: return "zero-four";
case 0x01: return "zero-five";
case 0x06: return "zero-six";
case 0x07: return "zero-seven";
default: return "UNDEF";
}
}
case 1:
{
switch(Convert.ToInt64(ck1, 16))
{
case 0: return "one-zero";
case 1:
{
if (Convert.ToInt64(ck2, 16) == 1) return "one-one-one";
else if (Convert.ToInt64(ck2, 16) == 5) return "one-one-five";
}
case 3:
{
if (Convert.ToInt64(ck2, 16) == 2) return "one-one-two";
else if (Convert.ToInt64(ck2, 16) == 3) return "one-one-three";
}
case 4: return "one-four";
default: return "UNDEF";
}
}
case 2:
switch(Convert.ToInt64(ck1, 16))
{
case 0x4E: return "two-fourE";
case 0x52: return "two-five2";
default: return "UNDEF";
}
}
}
}
Can anyone help? I'm stuck with this problem.
|
|
|
|
|
Blubbo wrote:
I'm trying to resolve this error
Control cannot fall through from one case label 'case 1:' to another.
Control cannot fall through from one case label 'case 3:' to another.
Make sure you put a break; in at the end of the code for case 1: and again at the end of the code for case 3:
C# does not support dropping from one case to another unless the previous case statement was empty.
i.e.
switch(id)
{
case 1:
case 2:
break;
} is valid
switch(id)
{
case 1:
case 2:
break;
} is not valid
Do you want to know more?
Vogon Building and Loan advise that your planet is at risk if you do not keep up repayments on any mortgage secured upon it. Please remember that the force of gravity can go up as well as down.
|
|
|
|
|
For the effect of falling through, you can use goto like so:
switch(i)
{
case 0:
goto case 1;
case 1:
goto case 2;
case 2:
return;
case 3:
case 4:
break;
default: throw new Exception("Ack!");
} It's not falling through to other cases, but I thought it was worth mentioning.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Same user as Blubbo...
Yeah I got it to work. I have checked out other documentations even the c# specification documentation.
I added break statement on every case and now things work. thanks to all for help.
|
|
|
|
|
Hi.
I have a simple standard button- FlatStyle is Flat, I've custom set the forecolor and backcolor to ActiveCaption, I have a small bmp image for the button, and have docked it to the right of a custom caption bar control. My complaint is that when I do a mousedown on the button, an ugly blue sort of highlighting appears both behind the button with a few lines across the image itself. How do I turn this off?
-David
|
|
|
|
|
not sure about the button, but if it's really a pain, then use a label with the same image and handle the click event.
|
|
|
|