|
This may not be possible unless you have an application sitting on the target machine that will publish how much disk space is free.
On the other hand, I'm no expert when it comes to Windows networking, so take this with a grain of salt.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Bought a House!
Judah Himango
|
|
|
|
|
how can I do to get a list of all the computer of a domain (The domain hasn´t got Active Directory)?
And how can with a list the printers?
|
|
|
|
|
i am working with [b]Windows control library[/b] in c#.i am using ShDocVw.dll in my project. i add a refrence of this dll into my project. but the problem is that when i complie this project it gives me an error dll doesn't have strong name. i already have one another dll with strong name. how can i add another dll using strong name. or i s there is any anther alternative to put this dll into Globlal Assembly.
Amit Grover
CDAC R&D
Gist Group
pune
|
|
|
|
|
Hi Amit,
If you want to add shdocvw.dll to the gac go to your project and then
In the solution explorer right click on the project name in the window.In the contextual menu click properties under the common properties\general category
you will see wrapper assembly for activex\com objects in the 'wrapper assembly key file' give the name of .snk file with wchih you want to sign this assembly.you can use the same key.compile it and then register it using gacutil.Hope it Helps.
Rakesh
|
|
|
|
|
i go through the same way as u have written.i named ShDocVw to "wrapper assembly key file" . where do i use this .snk Key.i had already used "AssemblyKeyFile" attrubute in Assemblyinfo.cs file. becoz i m using one another dll also.
after giving name ShDocVw to "wrapper assembly key file" when i compile.it is giving the same error " ShDocVw.dll does have strong name. if i used second AssembleKeyFile attribute in assemblyinfo.cs it is giving an error "duplicate assembly key file attribute" . how can i solve this problem
Amit Grover
CDAC R&D
Gist Group
pune
|
|
|
|
|
Hi,
I display a lot of images in a context menu, using OwnerDraw=true and overring OnMeasureItem/OnDrawItem. The automatically displayed arrows are great, but the menu takes all the screen height! My boss want the menu to be shorter...
I tried to display only a few images, and added my own arrow items at the beginning and the end of them, but I can't make the menu scroll when I click/select the arrows!
- when clicking the arrows, the menu automatically closes
- when selecting them, I dynamically modify the images items, but I can't make the menu update!
I tried everything: Refresh/Update/Invalidate of the parent control, PerformSelect on all the images items, calling SendMessage with WM_PAINT, WM_PRINT, WM_PRINT_CLIENT with the menu handle, and the parent control handle, I've even tried to set to false then back to true all the images items OwnerDraw, they update more or less, but the false ownerdraw menu (brief) displaying is awful!
I didn't manage to find an answer to my problems on the web, so if someone have a clue it would be great to tell me! Either about how making my long menu not taking all the screen height, or forcing the menu to update when I dynamically modify it!
Thanks a lot
Thibaud
|
|
|
|
|
Allow the menu to close as normal when the arrows are selected, update the items, and make it appear in the same location again.
If you added the context menu to the control using the "ContextMenu" Property create a delegate for the MouseDown event and note the location of the mouse when the right mouse button is clicked.
Update the menu items, then call:
myCtrl.ContextMenu.Show(myCtrl, savedX, savedY);
David
|
|
|
|
|
Hi, thanks for your answer. That's a goog idea yes, I will try it. But I'm afraid the menu closing then re-opening will be unaesthetic.
Otherwise, I have found another solution on a French forum: http://www.csharpfr.com/code.aspx?ID=34929
This solution consists in using the SetMenuInfo API to set the maximum menu height. But you also need to create a new contextmenu class, as SetMenuInfo needs a handle, and the only valid handle can be obtained by calling CreateMenuhandle, which is a ContextMenu protected method!
|
|
|
|
|
Considering that I'm a novice C# user there may be a very simple answer to this problem. I have 3 tabs in my application; one where the search parameters are entered and the second where the related file is displayed in a richtextBox. For some reason unless I view the richtextbox tab before I try load a file into it I am unable to view any loaded files. Any help in this regard would be appreciated.
Kind Regards,
Alvin
|
|
|
|
|
Some code would definitely help. Where are you instantiating the textbox?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
hi, how can i save a real picture on the SQL DB and retrieve it through .net
Thanks alot
Hamody
|
|
|
|
|
I'm having a very odd problem. I have a basic C# form app that pInvokes into a C++ dll. When I build my C++ dll and C# app in Release mode, the C# app can load the dll and call into it just fine.
However if I build the solution in Debug mode, the C# app throws a DllNotFoundException. I've double checked and the C++ debug version of the dll is being properly copied into the C# app's bin/debug folder, so its actually there.
Why is it able to load the release version and not the debug version?
|
|
|
|
|
dxben wrote: I've double checked and the C++ debug version of the dll is being properly copied into the C# app's bin/debug folder, so its actually there.
And the name of the debug dll is the same?
xacc.ide-0.1 released! Download and screenshots
|
|
|
|
|
Yeah its the same. Actually someone else pointed out to me that my debug dll is probably dependent on the debug dll of the CRT and that it can't find it. So I need to make sure the debug DLL of CRT is in my path. What is the filename of the debug crt DLL?
|
|
|
|
|
i have an object
public class Class2 : System.MarshalByRefObject
{
public Class2 ( ) { } // default constructor
public Class2 (string param1, string param2) { }
}
i cant use the 2nd constructor with remoting, when i use wsdl on the remoting url it doesnt have a signature for the 2nd constructor.
how do i implement this?
thanks
|
|
|
|
|
I guess you want an object instantiated with the second constructor to be registered with the remoting framework. If that's what you wanted to do, use the Marshal[^] method. Like
Class2 c2 = new Class2("x", "y");
RemotingServices.Marshal(c2,...);
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
HI,
I have a usercontrol with a testbox in it, and i am using "keydown" event of the textbox with in the control (for my specific functionality) .( i am using this control in my (win)form).
On form level i have one "Button". and i set "AcceptButton" property of form to this button.
My problem is, when i hit enter key while having focus on textbox of usecontrol, "Acceptbutton" property of form is executing instead of "keydown" event of usercontrol.
How do i make execute, "keydown" event of usercontrol on hitting enter key?
Regards,
satz
|
|
|
|
|
You can't get it to do both. AcceptButton is used to indicate the button that is to get the notification when the user presses Enter in the dialog.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
I have a trivial question.
When we create a C# windows application "bin" and "obj" folder is created in the project folder.
Will anyone please tell me that what is the signifance of these 2 folders.
Thanks a lot
|
|
|
|
|
The obj directory is a temporary directory. Visual Studio uses this for temporary files when compiling and linking. Files out of the bin directory are what you should deploy. This is the directory to which build variables like $(TargetPath) refer.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Thanks Heath
I got your point
|
|
|
|
|
The bin (binaries) folder is the one you should be using. The obj folder is used to hold temp build files and for debugging purposes.
The bin folder has seperate directories for your build types and generally you want to build .pdb files with your release build in case you have to do any remote debugging.
|
|
|
|
|
Hi.. I'm currently doing a web design on the calendar using C# web application.I have created a calendar. I would like to ask that if i click the date on the calendar, can i retrieve the database?? I have tried several times and it seem like is not working. Below is my code, could anyone help me that if i missing on any parts?? Thanks!! My code:
.
.
.
using System.Data.SqlClient
private void Calendar1_SelectionChanged(object sender, System.EventArgs e)
{
TBDate1.Text = CAL1.SelectedDate.ToLongDateString();
SqlConnection conn=new SqlConnection("put my connection string here");
string seldate = "Select * from Particulars where DateField = '" + TBDate1.Text + "'";
SqlDataAdapter DA = new SqlDataAdapter(seldate,sqlConnection1);
DataSet DS = new DataSet();
DA.Fill(DS);
DataTable DT = new DataTable();
DataGrid1.DataSource=DS.Tables[0].DefaultView;
DataGrid1.DataBind();
}
Thanks for your help..;)
Cheers!
|
|
|
|
|
First of all, never use string concatenation like that in SQL strings. All I have to do as an attacker is set the TBDate1.Text field (either in the page or via an HTTP GET or POST) to ' or 1=1; delete from Particulars; -- and your table is gone. With probing I could do worse, such as steal credit card information or other private information, etc. This is called a SQL injection attack and is one of the most overlooked vulnerabilities. Use parameterized queries using the SqlCommand.Parameters collection property.
That's also the answer to the problem here. Dates are typically surrounded by "#" (depending on the database management system) but using parameters eliminates having to know that:
SqlCommand cmd = conn.CreateCommand();
cmd.CommandText = "SELECT * FROM Particulars WHERE DateField = @Date";
cmd.Parameters.Add("@Date", SqlDbType.DateTime).Value = DateTime.Parse(TBDate1.Text);
Add some error-handling, though, since DateTime.Parse could fail if incorrectly formatted.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hello,
I've declared an instance of a class in the startup page of my app
eg Car mycar = new Car()
and have assigned various attributes into it.
I would like to refer to the instance mycar in other pages (either in the aspx or .cs )
eg mycar.model
I'm getting The type or namespace name 'mycar' could not be found (are you missing a using directive or an assembly reference?)
What's the best way to declare the instance of this class to my other pages?
thanks,
John
|
|
|
|