|
the exe is running in local client and downloading the file from webserver
when i double click it i getting what i need from the server...
but i use the code system.diaganostic.process.start("exe");
it is calling the exe suceesfully but download is not happened and no errors are shown.....
|
|
|
|
|
Trying to run the following console program from a 'Sam's' Learn C# book and getting a bunch of
errors; can anyone see what might be causing these please? (I'm only a C# rookie myself.)
Error 1 A namespace does not directly contain members such as fields or methods
Error 3 Invalid token '7' in class, struct, or interface member declaration
Error 4 Invalid token '9' in class, struct, or interface member declaration
Error 5 Invalid token '10' in class, struct, or interface member declaration
Error 6 Invalid token '11' in class, struct, or interface member declaration
Error 7 Invalid token '12' in class, struct, or interface member declaration
1: // Circle1.cs - Overloading the area method
2: //--------------------------------------------------------------------
3:
4: using System;
5:
6: public class Circle
7: {
8: public int x;
9: public int y;
10: public double radius;
11: private const float PI = 3.14159F;
12:
13: public double Area() // Uses values from data members
14: {
15: return Area(radius);
16: }
17:
18: public double Area( double rad )
19: {
20: double theArea;
21: theArea = PI * rad * rad;
22: Console.WriteLine(" The area for radius ({0}) is {1}", rad, theArea);
23: return theArea;
24: }
25:
26: public double Area(int x1, int y1, double rad)
27: {
28: return Area(rad);
29: }
30:
31: public double Area( int x1, int y1, int x2, int y2 )
32: {
33: int x_diff;
34: int y_diff;
35: double rad;
36:
37: x_diff = x2 - x1;
38: y_diff = y2 - y1;
39:
40: rad = (double) Math.Sqrt((x_diff * x_diff) + (y_diff * y_diff));
41:
42: return Area(rad);
43: }
44:
45: public Circle()
46: {
47: x = 0;
48: y = 0;
49: radius = 0.0;
50: }
51: }
52:
53: class CircleApp
54: {
55: public static void Main()
56: {
57: Circle myCircle = new Circle();
58:
59: Console.WriteLine("Passing nothing...");
60: myCircle.Area();
61:
62: Console.WriteLine("\nPassing a radius of 3...");
63: myCircle.Area( 3 );
64:
65: Console.WriteLine("\nPassing a center of (2, 4) and a radius of 3...");
66: myCircle.Area( 2, 4, 3 );
67:
68: Console.WriteLine("\nPassing center of (2, 3) and a point of (5, 6)...");
69: myCircle.Area( 2, 3, 4, 5 );
70: }
71: }
|
|
|
|
|
I can't see it. You are going to have to provide the line numbers that the compiler is giving.
|
|
|
|
|
Is there an easy way to do that? (It comes out as a big mess if I copy/paste.)
The first error is Line 1, Col 2 for some weird reason. I've actually gotten 18 errors.
|
|
|
|
|
Remove the line numbers with following colon at the beginning of each line.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Thanks Stefan! (Just noticed all the examples on cd for Day 8 of Sam's C# in 21 Days have
the same problem.)
On another note, is there a quick and easy way to remove a column of characters, for
future reference? (And to fix the rest of the programs quickly.)
|
|
|
|
|
it might be worth trying sams website, there may be updated working versions of the code available for d/l
Russ
|
|
|
|
|
I copy and pasted the class you posted into Excel and did a text to columns with : separator. I then copy and pasted column B into notepad then from notepad to a New Console application in VS. It did error with "A namespace does not directly contain members such as fields or methods" on compilation.
I looked through the code and noticed Excel had inserted a '0' above the line "class CircleApp". I removed this and it works perfectly.
|
|
|
|
|
Not sure if fiddling about with text to columns would be quicker than
a manual delete - I'm thinking the most efficient way to fix this
and similar problems might be with an Excel VBA macro?
|
|
|
|
|
hi, i just want to ask if there is a way to asign a null value to a variable of type int.
for example i can write this:
<br />
String testingString = null;<br />
while writting this gives an error:
<br />
int testingInteger = null;<br />
The error is: Can not convert null to 'int' because it is a value type
i am using this to assign a null value in database.
meaning the textbox the i take from it the value of the integer is empty i want to insert a null value in the database not an empty cell.
thanks in advance,
|
|
|
|
|
quiteSmart wrote: i just want to ask if there is a way to asign a null value to a variable of type int
If you are using .NET 2.0 you can use nullable types. You just add a question mark to the value type to make it nullable:
int? myVariable = null;
quiteSmart wrote: i am using this to assign a null value in database.
Just remember that when you are assigning null to a database you have to convert it to a System.DBNull.Value
|
|
|
|
|
Because................
String is a reference type and
int is value type........
Parwej Back...............DON of Developer.......
Parwej Ahamad
g_parwez@rediffmail.com
|
|
|
|
|
In a C#
WINDOWS BASED APPLICATION
I have GroupBox,I want to remove its borders or make them invisible whats the way to do it
Ankit Aneja
"Nothing is impossible. The word itself says - I M possible"
|
|
|
|
|
You might want to use a panel instead.
|
|
|
|
|
Or you could override the OnPaint event of the group box and make your custom painting, but this is some kind of hard.
|
|
|
|
|
Not really. But it would be simpler to use a Panel and override the Onpaint to draw the label text.
|
|
|
|
|
Can sm one tell me which on is better from the programmer's point of view, using SIP or H.323 or the combination of these, considerig feasibility aspect in wireless communication?
|
|
|
|
|
Hello Everyone,
Recently i want to convert an existing VB application to Visual Studio.Net(2005) using c#, Hibernate and Interbase database.
Now i m facing problem with the Hibernate connection.
I put the following code for Hibernate connection:
<nhibernate>
<add key="hibernate.connection.driver_class"
value="NHibernate.Driver.InterBaseDriver"/>
<add key="hibernate.dialect"
value="NHibernate.Dialect.InterbaseDialect" />
<add key="hibernate.connection.provider"value="NHibernate.Connection.DriverConnectionProvider" />
<add key="hibernate.connection.connection_string" value="Database=C:\ProgramFiles\Database\CLASS.gdb;User=SYSDBA;password=abcd" />
</nhibernate>
But this code generate an error.
Can anyone help me solving this problem?
Thanks in advance.
Robi
Software Programmer
|
|
|
|
|
Hello
I´m working on a project that implements a SQL server 2005 DB as the main DB. Users should be able to extract an given project from the main server DB and "copy" it to there own local machine and work on it there (offline). When they return to work, they should merge it with the main DB.
And I hoped it would be possible to show conflicts through vs.NET so that the user can solve them.
I´m wondering if anyone out there has ever implementet a solution with Merge replication from SQL Server 2005 in Vs.Net 2005.
And if this could be the solution to my problem?
Thanx
Spaz
|
|
|
|
|
Please don't cross post.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
i need good materials in oop with c# from begining to advanced
ma_refay
|
|
|
|
|
OOP isn't C# specific. Google "OOP" and there's a wealth of information.
|
|
|
|
|
The problem is that I cant paint a part of an image on the screen if its not rectangular. Instead the whole pic is painted which I don't need....
Secondly when I draw on the picture Box its not visible on it. Instead it appear beneath the picturebox.
ANd thirdly how can I save the edited image from the sceeen...... HEres a link 4 the demo project which is a sample 4 my project...
http://www.salonstyler.com/download.php
Any help making this type of software........... Wht will u recomment me should I use picturebox or simply paint the image on the screen??? Thanx in advance
|
|
|
|
|
I hope I understand your problem correctly,
You may find it easier to build your image up from a Bitmap object then set it to the PictureBox.Image property. Then you can easy save the image.
If only part of the image has been updated you can call the PictureBox.Invalidate Method. You can pass this a Region or Rectangle so only that part of the control is repainted.
|
|
|
|
|
samreengr8 wrote: Wht will u recomment me should I use picturebox or simply paint the image on the screen???
Always paint it yourself unless your needs are trivial
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|