|
|
Man that is one advanced program! For my standards atleast But it helped me alot actually. I think i get what you are doing when you save the file paths and serialize them to be used later. The thing is, i dont know how to do that with my tabs. When i choose to save the tabs i dont know how to get the tabs and the contents of the tabs. Is there some way to get all the tabs in the tab control, and the contents of the tabs (text in text boxes and such)?
I haven't lost 'till I'm the last one to cross the finishline.
|
|
|
|
|
TabPageCollection returns all the tabs in tab control. In order to get contents of the tab, you can build your own class to hold data and use databinding so that it will be automatically populated by the values of the controls on the tabpage.
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
hi,
I want to write a program or a service which disconnect a dial up connection whenever for example the mouse doesn't move for 5 minutes or ...
please help me on this.
please tell in what library's i can find useful things.
thanks
|
|
|
|
|
|
I know that there is a possibility to get the name of the file after choosing it in the FileDialog, like this:
String str=fileDialog1.fileName()
The String(str) includes the full address of the file.
for example:
str="c:\windows\system\abc.txt"
but i want only the file name(abc.txt).
how can i receive only the file name and not the full address?
thank you
G.
|
|
|
|
|
use safefilename like this
DialogResult dr= openFileDialog1.ShowDialog();
if(dr==DialogResult.OK)
MessageBox.Show(openFileDialog1.SafeFileName);
|
|
|
|
|
Try Path.GetFileName[^] passing the full path you get from the file dialog. Also see other static methods in the Path[^] class in case you are interested.
|
|
|
|
|
hi,
you can also use 'FileInfo' class to get some information of your file in the given path.
|
|
|
|
|
If I have method with a non void return type is there a way to make the compiler check that the returned value has been explicitly assigned?
e.g.
When the method signature is
int DoSomething(int inValue);
Can the intended usage of
int retVal = DoSomething(iv);
in contrast to
DoSomething(iv);
actually be enforced.
I'd like a compiler warning for this situation but I haven't found one.
Alan.
|
|
|
|
|
Hi,
there is no such thing, a method will execute when called, whether the return value is
used somehow or not; so you can not enforce its use.
The situation is different with a property: you can not invoke a property unless
you either assign it a value (setter) or read AND use its value (getter).
|
|
|
|
|
Thanks for the response. You confirmed that the situation is as I had thought it to be, in that the use of the returned value is optional and cannot be checked.
Alan.
|
|
|
|
|
How may I add an swf file into a web application in aspx file so that it will start running when an specific buttun is pressed(a button except of the swf link).
|
|
|
|
|
I'm not sure how to communicate between swf and asp events but one approach could be for example displaying an image instead of swf and when the button is pressed load the swf by any mean you want
I Wish the Life Had CTRL-Z
Wizard's First Rule : People are fool,they believe what they want to believe or what they afraid to believe
www.subaitech.blogspot.com
|
|
|
|
|
My Code in C#:
Object o1=new Object();
Object o2;
How can i copy the o2 object to be exactly like o1( no a reference. o2=o1 is reference).
i tried o2.copy(o1) or something like this but the method "copy" does not exist ;
Can you help me?
|
|
|
|
|
You can create an exact copy of the object using Clone() method if that type implements ICloneable interface
Do more work
Make more mistakes
Learn more things
|
|
|
|
|
by the way, i am using Visual Studio 2008.
what do you mean type? which type?
i added "ICloneable" here:
public partial class Form1 : Form,ICloneable
{
Object o1=new Object();
Object o2;
}
Thanks you
|
|
|
|
|
Admin887 wrote: // o2.clone() does not exist
It doesn't help if you appear to be angry with the person that tried to help you. Especially, when it seems you have misunderstood that assistance.
You cannot clone a System.Object because it does not implement ICloneable . Adding it to the Form1 class will not help, it only demands that you provide an implementation for the Form1 class.
Admin887 wrote: what do you mean type? which type?
A "type" in .NET can be a class, a struct, an enum, and so on.
The "type" the person was referring to was the type of the object which you are trying to clone. You can only add ICloneable to types that you create. You cannot add it to existing types.
Now, what do you really want to do? Creating a System.Object is generally not a very useful thing to do.
|
|
|
|
|
First of all, i am very sorry, really.unintentionally i added this smile. I do not mean it. i am very nice guy
And now to the question:
I created a GroupBox(groupBox1) that contains textBox and buttons(i created this with the design option on the Form).
i want to create a new Tab(only with code without designing) that contains gruopBox(g) exactly like groupbox1.
GroupBox g = new GroupBox();
Thank you for your attention
G.
modified on Sunday, June 29, 2008 5:30 AM
|
|
|
|
|
Hello all
I am hoping someone can help me here as I have been asked to write a little application which will report on the machine it is installed information such as operating system, ram, pagefile, whether oracle is installed and what version, etc, etc
I was hoping people would have any useful suggestions of how they think I can get all this information using C# as I am not sure, I was thinking of maybe the registy for some things but was hoping someone had some better suggestions.
Thanks in advance for any help that can be offered
|
|
|
|
|
Hey all, first-time-poster long-time-reader, etc.
I have already managed to use CryptoStream and FileStream to encrypt an individual image into another single file, and also then used CryptoStream, MemoryStream and then Image to decrypt and display the image in a picturebox on a form. This way none of the data is actually stored, unencrypted, on the hard drive (unless the user hibernates the machine with it in memory) - this is very important.
However, what I want to do is to 'import' multiple images into one (preferably compressed) file - so I need to concatenate them somehow and then run compression on them. This file needs to then be able to be unencrypted, decompressed and split back into the respective images, providing the user the ability to view each image.
Please note: I can't use temporary files, everything up until the saving of the one main encrypted file needs to be done in memory.
I don't know where to start, just wondering if anyone could point me in the right direction?
|
|
|
|
|
Hi friends.
I have a XML file like this :
<?xml version="1.0" encoding="utf-8"?>
<root ELEMENTS="11">
<BOOKMARK1 ID="1" />
<BOOKMARK1 ID="2" />
<BOOKMARK1 ID="3" />
<BOOKMARK1 ID="4" />
<BOOKMARK1 ID="5" />
<BOOKMARK1 ID="6" />
<BOOKMARK1 ID="7" />
<BOOKMARK1 ID="8" />
<BOOKMARK1 ID="9" />
<BOOKMARK1 ID="10" />
<BOOKMARK1 ID="11" />
</root> ;
I want select root's ELEMENTS attribute value.
I used this code :
X_Element = XElement.Load(FileName);
MessageBox.Show(X_Element.Nodes().First().Parent.Attribute("ELEMENTS").Value.ToString());
Is there a better way or this way is good for my work ?
Freshman
|
|
|
|
|
M-Dayyan wrote: Is there a better way or this way is good for my work ?
Yes, you need to pay attention to what you are doing and to what each of the objects already are.
I'm curious to know what your thought process of this was:
X_Element.Nodes().First().Parent
Becuase all that code does is get you back to the starting point. In other words:
X_Element == X_Element.Nodes().First().Parent
Also, the Value property on XAtribute already returns a string , so why redundantly call ToString() on it again?
Your code could be reduced to:
X_Element.Attribute("ELEMENTS").Value
|
|
|
|
|
Great.
Thank you.
Freshman
|
|
|
|
|
i want to create crystal report in run time, means through C# hard code
|
|
|
|