|
|
is there any easier way to do it
or
can we do it through another control
Hello Friends
|
|
|
|
|
well it is pretty easy by itself just dig into the sample code
Regards,
Lev
|
|
|
|
|
That's about as "hand to you on a silver platter" as it's going to get.
|
|
|
|
|
Hi friends...!
I'm developing a exe which converts pdf file to jpg/image file.
I searched web to find some code.But I couldnt find any.
Can anyone help me to do this.
I know this is a simple task.But I'm new to C#.
I'm happy if anyone can guide me to achieve my task.
I'm using VS 2008 express edition.
Thank you.
charithmax
|
|
|
|
|
Try iTextSharp[^] this is a PDF lib for .net
Regards,
Lev
|
|
|
|
|
I download a sample file in this site http://msdn.microsoft.com/en-us/library/bb676897.aspx
I'd like to use "Windows Live ID Client Sample" with delphi 2007 or delphi7.
I tried to import " Microsoft.WindowsLive.Id.Client.dll" but Delphi is just made connect functions.
When I show with VS2008, I can use my features function.
How can I use this dll or not?
Thank you
|
|
|
|
|
If you're asking how to use the dll in Delphi, then I guess you've got the wrong forum.
Try to ask the same question on some Delphi for .Net forums
Regards,
Lev
|
|
|
|
|
If the Delphi you're using doesn't target the .NET Framework, you'll need to write a COM-exposed wrapper, using C# or VB.NET or some other .NET targeted language, around the classes and methods you want to use in this .DLL so Delphi can use it.
|
|
|
|
|
Suppose I have a long byte that can represent some GBs and I want to read it for example as:
2 GB, 11 MB and 25 KB
I'm not interested in dividing it by (1024^3) for GB as an example to see 2.02 GB, I want to know how much is that 0.02 GB in MBs and KBs
Please help!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Muammar© wrote: I'm not interested in dividing it by (1024^3) for GB as an example to see 2.02 GB, I want to know how much is that 0.02 GB in MBs and KBs
Use the Math.Floor function for this. 2.02 - Math.Floor(2.02) is .02. You can then work out what that .02 is in MB, and do the same to get a remained for KB.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Brilliant as always
Thanks Christian!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Christian Graus wrote: Math.Floor(2.02) is .02
No, it's not. Math.Floor(2.02) is 2.0.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Guffa wrote: No, it's not. Math.Floor(2.02) is 2.0.
Not quite. He said 2.02 - Math.Floor(2.02) , which works out to 0.02.
|
|
|
|
|
Hey Guffa,
Guffa wrote: No, it's not. Math.Floor(2.02) is 2.0.
True, yet it was what I needed, this's how I finally managed it:
private decimal factor(int y)
{
return (decimal)Math.Pow((double)1024, (double)y);
}
private string format_bytes(long lng_Byte)
{
string str_value = "Infinity";
if (lng_Byte <= factor(5) && lng_Byte >= factor(1))
{
if (lng_Byte >= factor(1) && lng_Byte <= factor(2))
str_value = Math.Round(lng_Byte / factor(1)).ToString() + " KB";
if (lng_Byte >= factor(2) && lng_Byte <= factor(3))
str_value = Math.Floor(lng_Byte / factor(2)).ToString() + " MB" + " And " +
Math.Round(((lng_Byte / factor(2)) - Math.Floor(lng_Byte / factor(2)))
* (factor(1))).ToString() + " KB";
if (lng_Byte >= factor(3) && lng_Byte <= factor(4))
str_value = Math.Floor(lng_Byte / factor(3)).ToString() + " GB" + ", " +
Math.Round(((lng_Byte / factor(3)) - Math.Floor(lng_Byte / factor(3)))
* (factor(1))).ToString() + " MB" + " And " +
Math.Round(((lng_Byte / factor(2)) - Math.Floor(lng_Byte / factor(2)))
* (factor(1))).ToString() + " KB";
if (lng_Byte >= factor(4) && lng_Byte <= factor(5))
str_value = Math.Floor(lng_Byte / factor(4)).ToString() + " TB" + ", " +
Math.Round(((lng_Byte / factor(4)) - Math.Floor(lng_Byte / factor(4)))
* (factor(1))).ToString() + " GB" + ", " +
Math.Round(((lng_Byte / factor(3)) - Math.Floor(lng_Byte / factor(3)))
* (factor(1))).ToString() + " MB" + " And " +
Math.Round(((lng_Byte / factor(2)) - Math.Floor(lng_Byte / factor(2)))
* (factor(1))).ToString() + " KB";
}
else
str_value = lng_Byte + " Bytes";
return str_value;
}
Thanks Guffa.
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Use the divison (/) and modulo (%) operators to split the size value:
long size = 2159043692;
long b = size % 1024;
size /= 1024;
long kib = size % 1024;
size /= 1024;
long mib = size % 1024;
size /= 1024;
long gib = size;
Console.WriteLine("{0} GiB, {1} MiB, {2} kiB and {3} bytes", gib, mib, kib, b);
Output:
2 GiB, 11 MiB, 25 kiB and 108 bytes
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
|
Can anyone tell me if it is possible to draw shapes and have them visible in the visual express editor. I can draw them in my code but it would be easier to use in the form editor. I was hoping to be able to add rectangles and lines just like buttons and menus...
|
|
|
|
|
No, Visual Studio, even the most expensive versions, is still not a painting program. You want to draw lines, the IDE doesn't give you much to help. I find using graph paper is a good way to work stuff out if you need to.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I was really after a way to add a flow chart to my program. Any ideas
|
|
|
|
|
yEd[^] seems to be pretty cool.
Regards,
Lev
|
|
|
|
|
Oh, I'm sorry, I just misunderstood the question.
You can try FlowChart.Net[^]
Regards,
Lev
|
|
|
|
|
I don't know it they'll show up in the C# toolbox, but the VB.NET PowerPack[^] has Line and Shapes controls that might do what you want.
|
|
|
|
|
I uave a simple appliction that opens a MS access DB. The program works fine on the development workstation but when I run t on a different WS I get the following error:
"GeneticOLEDB or one of its dependencies was not found"
I am trying to find what dribers (ODBC) I need to copy/configure on target machines.
any help is greatly appreciated
|
|
|
|
|