|
i've serched into all my pc but no found.
Where can i downalod it? and where can i found a tutorial to use?
|
|
|
|
|
Susuko wrote: Where can i downalod it?
You could try reinstalling the .NEt framework or VS200x.
Susuko wrote: where can i found a tutorial to use?
Here are a few:/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
Hello
I want convert a file into a stream.
I do it like this:
FileInfo fl = new FileInfo(@"C:\test.wav");
Stream sm = fl.Open(FileMode.Open);
But I do not think this is the best way to do it!
Can someone tell me if this is a good way, or maybe tell me a better way of how to do this?
Thanks
QzRz
|
|
|
|
|
This is a good way, but the FileInfo object is not necessary (unless you are using it somewhere else).
Try this:
Stream sm = new FileStream(@"C:\test.wav", FileMode.Open);
Hope this helps,
DigitalKing
|
|
|
|
|
Thanks for the fast reply
I do not need the FileInfo, so the answer you gave me is very good.
Thanks
|
|
|
|
|
What DigitalKing said, but you could also use the using statement to close the stream and release resources correctly. Something like
using (Stream s = ...)
{
}
Regards
Senthil
_____________________________
My Blog | My Articles | My Flickr | WinMacro
|
|
|
|
|
i m making a programe which show the logical drives using string how can represent it in tree view form
majid shahid
|
|
|
|
|
You are looking for the TreeNode[^] class. You can access the nodes in the tree using treeView.Nodes , so to add nodes, just do treeView.Nodes.Add(yourtext) . To add subnodes, get a reference to the TreeNode object using treeView.Nodes[i] and then call Add on its node collection.
Does this answer your question?
Regards
Senthil
_____________________________
My Blog | My Articles | My Flickr | WinMacro
|
|
|
|
|
how can i represent the string in treeview form.
majid shahid
|
|
|
|
|
What the heck are you talking about?
|
|
|
|
|
Hi,
I have a problem with checkbox. Actually i have a form on which there are two grids, two radio buttons and a check box. Basically when i databind the check box and/or radio buttons, the other controls dont work properly. Specially when adding new rows to grids(Which are added by clicking NEW button on the tool bar) the CURRENT row does not get to the new row. And also the only textbox does not become blank when we click NEW. I know there is some problem with Checkbox databinding but i really dont know what that problem is and how to remove that problem. Please tell me if any one know about that...
Regards,
Wasif Ehsan,
Software Engineer.
-- modified at 9:25 Saturday 6th May, 2006
|
|
|
|
|
VS 2005 C# Express, .NET 2.0
The following code causes the Body member of the Webbrowser control to be set to null. Why?
mshtml.IHTMLDocument2 doc2 = (mshtml.IHTMLDocument2) this.webBrowser1.Document.DomDocument;
doc2.designMode = "On";
I am trying to programmatically select an element (<OPTION>) in a web page listbox (<SELECT>) the way a user would with the left mouse button. So, far I've found nothing that will do this.
|
|
|
|
|
cweeks78681 wrote: I am trying to programmatically select an element (OPTION) in a web page listbox (SELECT) the way a user would with the left mouse button.
What does that have to do with setting designMode to ON?
Would you know how to do that in a javascript running in the HTML page? If not you should learn how to do that first because it is the same thing. The DOM in WebBrowser is the same DHTML DOM you use in javascript.
You want to get a reference to the DHTML listbox element and set it's .selectedIndex property to the desired index.
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum
led mike
|
|
|
|
|
> What does that have to do with setting designMode to ON?
It was a shot in the dark. I thought maybe the HTMLDocument was in some kind of read-only state because I have NEVER found a way to modify a page in the web browser. Some kind of exception is always thrown. One said something about an access violation.
|
|
|
|
|
That's what I call it, anyway...
I want to write a class that would know how to act on two different cases:
- A single object of it was created.
- An array of objects of it was created.
The purpose of this is to fire a different event for each of the cases.
Lets take WinSck for example...
If you create a single object, you get the regular arguments.
But create an array, and it automatically generates the same event with an additional index argument.
1. How can I detect from within my class if it's used as an array?
2. How can I, after detection, pass the index of the object, without holding an index/id field inside the class?
Thanks in advance,
Shy.
|
|
|
|
|
Hu?
I don't think you made yourself clear enough to get helpful answers.
When you want to know how many instances of your class have been created, you can increase a static counter in the c'tor of your class, for example.
But your class will never know if it's part of an Array or not, unless you define a separate Collection class to hold elements of your class.
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
1. You can't. How the reference to an object is stored is not known to the object.
What you can do is to use a static variable in the class that keeps track on how many objects has been created.
2. You can't. Same reason.
---
b { font-weight: normal; }
|
|
|
|
|
Thank you both for you comments...
I've got an idea, but not sure if it's possible.
I can create two different classes that will inherit thier common stuff.
Each of this classes would call the appropriate event (With/out index).
One of them will use a static field as you both mentioned.
BUT... Question is...
Can I force one class to be used as an array, and not as a single object?
Maybe inheriting both System.Array, and my base class would help?
Thanks,
Shy
Added:
Or maybe I can just implement ICollection...?
-- modified at 11:29 Saturday 6th May, 2006
|
|
|
|
|
I have a custom collection class that is bound to a PropertyGrid object, which functions very well. Part of the collection class is as follows:
public DotCommand[] Attributes
{
get
{
return attributes;
}
set
{
attributes = value;
if (AttributesChanged != null)
AttributesChanged(this, new EventArgs());
}
}
The PropertyGrid shows the Attributes item, with an ellipsis button (...); when I click on the button the Object Collection Editor appears and I can add items (the DotCommand object is very simple, it just contains two string objects, exposed with public get/set properties). When I dismiss the Object Collection Editor with Ok, the setter for the Attributes property above is not hit. If I press the ellipsis again, only the last added item is displayed (the others are gone).
What do I need to do to wire the PropertyGrid and Attributes property together properly? Is it because the Attributes property is an array (DotCommand[] )?
- Dy
|
|
|
|
|
-Dy wrote: When I dismiss the Object Collection Editor with Ok, the setter for the Attributes property above is not hit.
This is the correct behavior. The Object Collection Editor is not allowing the user to choose which array the property should be set to, but, rather, is allowing the user to modify the contents of the array. The objects in the array are being edited.
-Dy wrote: If I press the ellipsis again, only the last added item is displayed (the others are gone).
This might be due to the fact that the property is an array type. If you were to use an ArrayList instead of an array, does that fix the problem? I imagine it would.
Josh
|
|
|
|
|
I the days of COM we had reference counting, which i beleive probably still exists within .Net in some form or other otherwise the gargabe collector wouldn't be able to do it's job.
I basically want to code a simple but semi intelligent cache, where upon an object being added to the cache it remains there whilst there's more than one reference to it. One of the references being the cach of course. But when only the cache has a reference and maintains that single reference for around say 5 mins, after 5 mins it unloads it. I'd like the cache to manage this without the business object having to know anything about the cache, otherwise I could probably place a call within the business objects dispose() to decrement a reference count of some form.
The reason for this is to create a smart datalayer and reduce the number of trips to the database for certain business objects.
Or is there another way????
Andy
|
|
|
|
|
|
Hi all I am doing a project in C# in which I need to get html,doc,and txt files from the selected directory and leaving the remaining files. now stringpattern argument of GetFiles method only allows us to get one or all type of documents in the directory plz tell me how can i get three types of documents
Regards,
|
|
|
|
|
It's simple !
Call "GetFiles" for each file type.
<br />
string folder = "c:\\";<br />
ArrayList list = new ArrayList();<br />
list.AddRange(Directory.GetFiles(folder, "*.html"));<br />
list.AddRange(Directory.GetFiles(folder, "*.doc"));<br />
list.AddRange(Directory.GetFiles(folder, "*.txt"));<br />
string[] files = (string[])list.ToArray(typeof(string));<br />
Best regards, Alexey.
|
|
|
|
|
thxx brother but i want a technique through which i get all of these documents in one pass. coz if now i tried this i have to change the whole design of my project which is not possible so is there any other way out ??
-- modified at 5:04 Monday 8th May, 2006
|
|
|
|