|
Unless you get your network admin to comprimise the entire security of the linux box, this is definately not possible from C#, neither will it be even if you are non-root on the linux box itself.
|
|
|
|
|
is it possible with any other developing way to delete file. e.g. telnet c#,ssh c#.net code or any other developing code.?
|
|
|
|
|
Can you get to the file via normal means ie putty or a mapped network drive?
C# isn't going to get you access to the box that you don't have using other techniques.
Russell
|
|
|
|
|
1. When does this exception occur “Index out of range”?
a. Opening a database connection
b. On datatype mismatch
c. On accessing a data column not existing
d. When dead lock occurs
2. Which of the following object is used to catch a run time error?
a. Runtime.error
b. Exception.InnerException
c. Err
d. Error.runtime
3.What does WSDL stand for?
a. Web service Dynamic Language
b. World Service Data Language
c. Web service Design Language
d. Web service Description Language
4.Event supported by Dropdownlist
a. OnKeyup
b. OnKeypress
c. OnChecked
d. OnDatabound
5. Namespace used to connect SQL Server 2000 database
a. System.Oledb.SqlServer
b. System.Odbc.SqlClient
c. System.data.SqlClient
d. System.data.SqlServer
6. How to generate a javascript code at run time?
a. Page.RegisterClientScriptBlock()
b. Page.RegisterClientScript()
c. Page.RegisterScriptBlock()
d. Page.RegisterScript()
7. How many script tag can a .net page can have?
a. 5
b. 10
c. 20
d. Unlimited
8. Most efficient way of concatenating two strings
a. String1.Concat(String2)
b. String1 & String2
c. Concat(String1,String2)
d. StringBuilder.Append(String1).Appent(String2)
9. Choose odd one out
a. DataSet
b. DataTable
c. DataReader
d. DataAdapter
10. How to access a value from Web.config?
a. Configuration.AppSettings()
b. ConfigurationManager.AppSettings()
c. Configuration.Settings.AppSettings()
d. Configuration.App.Settings()
11. How to assign a javascript event to a asp.net button control?
a. Button.AssignScript(“onClick”)
b. Button.Attributes.onClick()
c. Button.Attributes.Add(“onclick”)
d. Button.Attributes.AddScript(“Onclick”)
12. If Session.timeout=30. When will the session expire?
a. 30 Milliseconds
b. 30 Minutes
c. 30 Seconds
d. 30 Hours
13. Which of the following method transfers control from one page to another and preservers the form values in the first page.
a. Server.Transfer()
b. Response.Redirect()
c. Request.Show()
d. Request.Display()
14. A Web service can only be written in .NET?
a. True
b. False
15. A set of tables are maintained in a Dataset as
a. TablesCollection object
b. DataTableCollection object
c. DataRowsCollection object
d. TableRowCollection object
plz help....
|
|
|
|
|
You forgot,
16. How does a student learn C#:
a. Ask people to do his/her homework.
b. Programming is stupid, I'd rather be a movie star.
c. He/she takes the initiative and does a few simple google searches.
d. Learn to write and even speak in native binary, C# is bound to be easier then...
|
|
|
|
|
Answer of Question 1
(from your options)
c. On accessing a data column not existing
in general this exception occurs when someone try to access the index an array that is outside the bounds of the array.
Answer of Question 2
None of the mentioned choices..
Answer of Question 3
None of the mentioned choices..
Answer of Question 4
a,b
Answer of Question 5
c
Answer of Question 6
None of the above
Page.ClientPage.RegisterClientScriptBlock() //Check this.
Answer of Question 7
Not sure
Answer of Question 8
StringBuilder.Append
Answer of Question 9
c
Answer of Question 10
c
Answer of Question 11
c
Answer of Question 12
30 Minutes (not sure)
Answer of Question 13
Server.Transfer (again google about it)
Answer of Question 14
False
Answer of Question 15
b
AND THE ANSWER TO ALL THESE QUESTIONS IN ONE WORD "GOOGLE"
|
|
|
|
|
http:\\www.google.com
|
|
|
|
|
1. Neither
2. Neither
4. Neither
6. Neither
8. Neither
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
No wonder so many people passing software courses nowadays...
|
|
|
|
|
Can anybody help me getting the "CrystalRuntime.Application",
i am new to crystel report .. i am converting some VB code in to C#
but i dont know how to convert following code...
Dim vorep As New CRAXDRT.REPORT
If avoA Is Nothing Then
Set avoA = CreateObject("CrystalRuntime.Application")
End If
Set vorep = avoA .OpenReport(Report)
vorep.EnableParameterPrompting = False
If vorep.HasSavedData Then
vorep.DiscardSavedData
End If
can anybody help me here....
T@SU
|
|
|
|
|
Any one know how to create an airbrush drawing tool.
|
|
|
|
|
I would guess that you will need to randomly choose a certain number of pixels within the brush area, and color them as needed. I think that the distribution function is uneven for that type of effect, so you should probably do something like picking a radius and and angle, then coloring that pixel. That way, the center has a higher probability of being colored than the outside. Good luck,
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
You might want to google: Paint .NET, it is an entire drawing suite that I believe was written in VC#, if not VC# at least .NET. It is Open Source
Regards,
Thomas Stockwell
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.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Hi All,
I have a win app with two forms involved. Form1 opens up Form2. When I go to close Form2 I want to refresh some grids on Form1. I tried setting up a custom eventhandler but its kind of hokey. I need some way to call a method in Form1 from Form2. Does anyone have the best way to do this? I passed a Form1 reference to Form2 and tried to see if a public method that I declared in Form1 was visible but doesn't show up. So I went with trying to create a custom event in Form1 and calling it from Form2 but not sure the best way to do this, any ideas?
Thanks,
JJ
|
|
|
|
|
A quick question. Is Form2 shown modally? If so, at the point the Form2 is closed (right after it is declared in whatever method Form1 instantiates it), that is where you can refresh your data.
If the above situation doesn't work for you, I would consider reworking the whole public method thing you tried. Perhaps you didn't pass reference of Form1 to Form2, instead, you passed reference to a regular System.Windows.Forms.Form.
Something like
public void OpenForm(Form myForm)
is NOT the same as
public void OpenForm(Form1 myForm)
because Form1 is the actual object that would have your method contained in it.
That is probably why you didn't see that method show up in your Intellisense list. (I don't know, I'm just taking a guess...)
Hope that helps.
|
|
|
|
|
|
In .net best thing to do this is through Delegates
|
|
|
|
|
How to change cursor?
This not working!
Cursor.Current = Cursors.Cross);
Thanks.
Alex
|
|
|
|
|
What is not working?
You might want to take the ) out of your code.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
try myForm.Cursor=Cursor.Cross; , each Control has a Cursor property.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- 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 PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Ah,ok! Thanks a lot!
Alex
|
|
|
|
|
I'm trying to implement AFORMAUTLib.dll in my C#, CSharp application. The DLL contains many interfaces, namely, CAcroApp, and CAcroAVDoc, each of which contain many methods, such as open(), Exit()...etc.
I've added the reference and implemented each interfact implicity like this:(yes, I implemented each method)
public class adobe : Acrobat.CAcroApp
{
#region CAcroApp Members
public int CloseAllDocs()
{
throw new Exception("The method or operation is not implemented.");
}
public int Show()
{
}
public class pdf : Acrobat.CAcroAVDoc
{
#region CAcroAVDoc Members
public int BringToFront()
{
throw new Exception("The method or operation is not implemented.");
}
public int Open(string szFullPath, string szTempTitle)
{
}
I've shown two methods for each interface (there are about 20 methods total for each interface) The methods contained exception handling, I removed the handling from Exit() and Open().
Now I'm stuck. I call the Open() method like this:
pdf pdfThis = new pdf();
pdfThis.Open("myPath", "tempName");
When I try to run the code I get the following errors:
Error 1 'WindowsApplication1.adobe.Exit()': not all code paths return a value
Error 1 'WindowsApplication1.adobe.Show()': not all code paths return a value
I don't understand what I am doing wrong. I am assuming this means I have to add code between the curly braces under the Open() and Exit() methods, but if that's the case, what's the point of accessing those methods, if they don't do anything on their own? I am completely lost. Any help would be greatly appreciated.
|
|
|
|
|
Hi,
an interface is like a contract, where you promise to provide certain methods and properties.
"implementing an interface" means providing code that fits the interface, so if adobe.Exit()
is part of the interfasce, then you have to provide all the code to make the Exit() method
do what it is supposed to do, one of the issues is whatever program flow is executed inside it,
it must return a value of the agreed upon type.
It may be wise to open your C# book and read up on interfaces...
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- 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 PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Thank you for trying to help, however...I've read something very similar, or exactly the same, as your words at least 50 times before I posted, both in my C# books, and online. It just doesn't click...
I've got this interface that provides an Exit() method that does what? gives a place for me to add code for a program to exit (isn't that what the method is for)? That makes absolutely no sense to me. I don't understand the point of an interface that provides methods, if those methods do absolutely nothing except let you put code in and have it return an Int (in this case).
Why do I need an interface's Open() method to open a program if I've already supplied the code to do so?
what would I do with the return value?
Are there any real world examples of this? Something not generic like myprivatmethod accessed through mypublicmethod because that doesn't help me get it at all...
What am I not getting?
|
|
|
|
|
OK, I will provide a simple example about sorting collections, such as arrays, ArrayLists, etc.
The Array class has a static Sort method Array.Sort(Array) which is fine
when the array contains strings that you want sorted alphabetically. But maybe the items in the
array are not strings, or you need a special sort order.
The Array class also has a static Sort method where one of the overloads reads:
Array.Sort (Array, IComparer)
which means it needs an Array to be sorted, and an object that tells how to sort, by implementing
the IComparer interface, which defines a single method, like this:
int Compare (Object x,Object y)
Lets say my specific array contains objects of class Person which has a FirstName and LastName
property (bothpublic strings), and I want to sort them by LastName, and when equal by FirstName.
here is code that does exactly that:
class PersonSorter : IComparer {
public int Compare(object x1, object x2) {
Person p1=x1 as Person;
Person p2=x2 as Person;
int diff=string.Compare(p1.LastName, p2.LastName);
if (diff==0) diff=string.Compare(p1.FirstName, p2.FirstName);
return diff;
}
}
This is how we use the sorting object:
Person[] people=new Person[100];
Array.Sort(people, new PersonSorter());
Maybe in another occasion we have an ArrayList of Person objects, we can reuse the PersonSorter
to sort the ArrayList in the same way, since ArrayList too has a Sort method that takes an
IComparer to explain how to sort; this time its an instance method, so we would need:
myArrayList.Sort(new PersonSorter());
And later when we want to sort by FirstName first, we should create another class implementing
IComparer and pass an instance of that class to the Sort method of our collection.
The overall picture is: Array, ArrayList have been defined to work with IComparer (Microsoft
did not know about your Person class when they designed arrays and lists), all they care about
is the Compare method, so all you need to do is provide one; implementing an interface is
two things:
- providing the methods as specified in the contract
- telling the compiler you did so(by adding ": IComparer" to the class statement), so it can check things.
At first it may be surprising that we need a new class to explain how we want to sort; in fact,
we can add the Comparer method to an existing class. If there is only one way to sort the Person
class objects, we could add it in there. But sometimes it is wise to keep it separate.
On the other hand PersonSorter might contain more members and more methods, maybe it inherits
from another class (it could be a specialized Form, a calculator, whatever). As far as Array.Sort
is concerned, the only thing that matters is that it implements IComparer.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- 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 PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|