|
There is nothing to worry about. Just add its namespace to your class and use it there. Then you can call each method or propoerty you want in your web methods.
Mazy
"Man is different from animals in that he speculates, a high risk activity." - Edward Hoagland
|
|
|
|
|
You should probably consider creating three projects/assemblies (depending on whether you're using Visual Studio or not). (1) The client application, whether Win or Web Forms; (2) The data access layer, your Web service app; and, (3) a project/assembly that contains common classes. You would deploy assembly 3 with both your data access layer and your client application.
Michael Flanakin
Web Log
|
|
|
|
|
double a = 212.45 ;
double b = 6795.9 ;
double c = a + b ;
The result of c is 7008.3499999999995. I cannot understand why the result isn't 7008.35. Anyone can explain that to me ?
Thx a lot
|
|
|
|
|
Internal rounding error
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
|
|
|
|
|
What does that mean exactly ?
Do you mean that .NET double type does rounding error ? No exception at all are thrown from framework.
I resolved it using decimal type but I'd like to understand why this rounding error happens with Double .
Thx
N0rthernlights
|
|
|
|
|
The binary representation of fractional numbers is an approximation. Just as the fraction 1/3 must be approximated when represented in a decimal notation. I would pose a question, though. Since the two numbers you are adding have only 5 and 6 digits of significance, why are you expecting more than that when adding the two together. If you round the result to only be 6 significant digits, you will have the correct answer. The double type can only have 17 digits and once you begin operating on them, the accuracy usually falls down to only about 13 or 14 that are correct.
Chris Meech
We're more like a hobbiest in a Home Depot drooling at all the shiny power tools, rather than a craftsman that makes the chair to an exacting level of comfort by measuring the customer's butt. Marc Clifton
VB is like a toolbox, in the hands of a craftsman, you can end up with some amazing stuff, but without the skills to use it right you end up with Homer Simpson's attempt at building a barbeque or his attempt at a Spice rack. Michael P. Butler
|
|
|
|
|
I've run into problems with the same issue before. The only way I could fix the rounding error was:
double c = a + b;
c = Math.Round( c, 2 );
Hope this helps.
|
|
|
|
|
As far as i remember the double is accurate for 12 digits after the comma.
And as Chris Meech mentionned, the internal represntation of fraction is not the same the one for decimals.
Also if you Round your Number to 12 digits of precision (you have 13), you would get exactly 7008.350000000000
|
|
|
|
|
Thx all for your answers . I now understand that internal fraction representation has some special behaviour. I'll use Decimal type because it's much easier to work with it to calculate money values.
|
|
|
|
|
Hi, I want to use resource files to store message box strings. Which I read that I can by defining Name = value pair in text file. like ex > Close = "Really wann quit this application". But now the problem is where should I wirte this text file and then where should I compile Resgen myResource.txt , to create myResource.resource file. Now after doing all this how should I use these Name of string in my application to call resource file. Thanx for ur support.
Inpreet Singh
|
|
|
|
|
As I've been trying to tell you in an old thread, use a ResX file in VS.NET instead and mark it as an embedded resource. Forms and controls already have a hidden ResX file associated with them. You can use .txt files but you'll have to compile them manually - like I also said before - using resgen.exe to the appropriate name (fully-qualified name) and embedding them with the csc.exe compiler using the /res option.
If you use a ResX file, you can centralize/localize more than just string resources, including various structs and classes that have a TypeConverter associated with them.
I also gave you a link to check out that shows MANY examples of using the ResourceManager and even a code snippet, which I'll post again:
ResourceManager resources = new ResourceManager(typeof(SomeClass)); Use the code above is a .resources file would have the same namespace and name (fully-qualified name) as a class. If now, you have to use the name and get the assembly, something like:
ResourceManager resources = new ResourceManager("MyResources.resources",<br />
this.GetType().Assembly);</pre>...where <code>this is an instance of your class that will use the resources. You need to get the Assembly and this is one of many ways to do it (one of the faster ways).
Here's that link[^] again for the ResourceManager class.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hello,
I have a non-rectangular form that I created by overriding the form's paint method and adding the following:
<br />
System.Drawing.Drawing2D.GraphicsPath myGraphicsPath = new System.Drawing.Drawing2D.GraphicsPath();<br />
<br />
myGraphicsPath.AddLine(...);<br />
myGraphicsPath.AddLine(...);<br />
myGraphicsPath.AddLine(...);<br />
<br />
this.Region = new Region(myGraphicsPath);<br />
Now, the form is the shape I want (diamond) but the edges are jagged. Is there any way for the lines to be smoother, so that the edges are not jagged? Is there any method I can use other then AddLine to get a smoother edge?
Thanx for the help,
-Flack
|
|
|
|
|
If u take printscreen of an image which has smoother edge and u see it in a magnified view, u can see some pixel in an intermediate color in between the edges and the background. That pixels make the edges smoother.
You can draw another line in a lighter color around the form border.
I hope it will work.
|
|
|
|
|
What you're looking for is called "antialiasing", where the color used slowly tapers off to the background, rather than being a crisp border.
Run a search for "Antialiasing in GDI+" and you should find plenty of stuff...(don't have my MSDN handy)
Jeremy Kimball
|
|
|
|
|
Hi all,
I am new bee in C#, I want to start an exe and stop it later some time in my C# application, How to do that?? Pl. help me.
Thanks &
Reg,
Satya
|
|
|
|
|
See the documentation for the Process[^] class in the .NET Framework SDK.
As a simple example:
Process p = Process.Start("calc.exe");
Thread.Sleep(1000);
p.Kill();
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi Heath,
Thanks for the reply. Is it possible to make the window of the application invisible. For example if I am starting some "x.exe" using Process.Start(), can I make that x.exe's window invisible, so that user won't know that some exe has been started in the back ground. If you have any idea please let me now.
Thanks and Regards,
Satya Prasad
|
|
|
|
|
Prcess class has a StartInfo property, look into it and you will find it.
Mazy
"A bank is a place that will lend you money if you can prove that you don't need it." - Bob Hope
|
|
|
|
|
Thanks Got it.
Regards,
Satya Prasad
|
|
|
|
|
i dont know how to start
if you have any usufull information about avi to mpeg compression please send it to me
1-how can i read a film and convert it in frame and then store it in amatrix !!!!!
please help me
|
|
|
|
|
first of all how do i display a .tif file on a form
second i need to know how to filp,rotate,zoom in ,zoom out
useing the .tiff image so if come body could give me example code to do this that would be great
chad
|
|
|
|
|
Put a System.Windows.Forms.PictureBox on a form, then set the .Image property to the image file on disk. You can create a System.Drawing.Image using System.Drawing.Image.FromFile. For zooming and flipping, you need to do it yourself most likely. Grab some of the pixels using Bitmap.GetPixel then draw it in a larger fashion (say, 4 pixels for every 1 you read in).
---------------------------
He who knows that enough is enough will always have enough.
-Lao Tsu
|
|
|
|
|
Or better yet, use the Graphics class and call any one of the many transformation methods, like ScaleTransform , RotateTransform , et. al. You can find more information about these in the .NET Framework SDK.
In this case, you can either create a new image from the existing one (see Image.Clone ) and use Graphics.FromImage to get a new Graphics object for it and then assign that to PictureBox.Image , or paint the image yourself in your Form 's OnPaint override. Read the .NET Framework SDK for more information.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
is there a way if the picture is too big for the picturebox for the picturebox to scroll throw the picture because it dose not have a scroll on it now
chad
|
|
|
|
|
Not the picture box itself, no, but there are workarounds. Set PictureBox.SizeMode to PictureBoxSizeMode.StretchImage if you want the image resized. If you don't, put the PictureBox in a Panel and set PictureBox.Bounds to the containing Panel.Bounds (do not dock). Also set the Panel.AutoScroll to true . Then, set PictureBox.SizeMode to PictureBoxSizeMode.AutoSize . This will resize the PictureBox to the size of the image. Since the control is docked inside a Panel with auto-scrolling enabled, the panel will provide scrolling.
Microsoft MVP, Visual C#
My Articles
|
|
|
|