|
Try using PointToClient on the treeview.
|
|
|
|
|
When the MemoryStream is closed you can still get the data in the stream using GetBuffer - but I cannot get the length of the data in the stream - an exception is thrown saying stream is closed. I know what you are going to say is don't close the stream but I don't have a choice as this stream has been manipuated by the CryptoStream class and to process the last block I have to call Close and that in turn closes my MemoryStream - I can understand not being able to manipulate the position in the stream but not allowing to see the Length when closed seems a bit odd. Can anyone help - I am considering writing my own memory stream type class if I can't work this out.
|
|
|
|
|
|
Alas I wish it was that simple - it tells me that the length of my buffer is 0x100 (256) but I know that the encryped data will only 2 blocks (32 bytes) so that is not a good indication - examining the MemoryStream it tells me that the position and length is 0x20 but I cannot access that data directly
However I think I have it - if I use ToArray() - then I get a buffer that only contains the data and is of the correct length - just a bit convoluted and it still doesn't explain why you cannot get the Length property on a Closed Stream
> p.s. Are you sure you can call GetBuffer on a closed stream
yup - it doesn't throw any exceptions and the data is fine to use later
|
|
|
|
|
I want to write a program for IIS with C#.Which class should I use? If I have to use win32 api what are the names of functions related to IIS in win32?
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
What do you mean by "a program for IIS"? A website, an ISAPI filter, an MMC snap-in, etc?
James
"Java is free - and worth every penny." - Christian Graus
|
|
|
|
|
I want to write a application for administrating user accounts.Does "active directory" programming useful for it? I THINK System.DirectoryServices namespace is what I want.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
If your users are in Active Directory (NT user accounts), then System.DirectoryServices is the right place to start, using either the WinNT or LDAP providers. MSDN has some good documentation, or check out http://www.15seconds.com/focus/ADSI.htm.
|
|
|
|
|
Thank you Richard.What about IIS setting?
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
The simplest method:- In IIS, properties of the application root, turn off anonymous access, and turn on basic or integrated authentication;
- Enable impersonation in web.config;
- Log in as a user with permissions to access / modify Active Directory objects, e.g. administrator;
If you want to get more complicated, you can pass login credentials to the DirectoryEntry object, but this could expose the directory to anonymous users.
|
|
|
|
|
I created a Web Service with an only method...
[WebMethod]
public string[] Test1()
{
string[] tStrings = new string[2];
tStrings[0]="first";
tStrings[1]="second";
return tStrings;
}
After deploying it I attempted to test my method with SoapLite (module for Perl). I worked with SoapLite before and never had troubles.
Using my operational experience with SoapLite I started client, but... inplace of an XML - Response I espected to receive after calling my method, I saw an only string - "HASH(0x84fca1c)".
Pls, help me, I can't see where is my mistake...
DMT Labs, Intelifarm group.
Ilyin Nikolay (aka Koenig).
|
|
|
|
|
If I have a COM+ Component(EnterpriseServices). If I have the activation set as server and I instantiate it in 2 places do they both get the same instance? And if not is there a way around this? Thanks.
Steve
Not all who wander are lost...
|
|
|
|
|
You have two options for server-activated objects: Singleton and SingleCall.
In the case of Singleton, the remoting will only create one instance and every client-call will be routed to the same instance.
In case of SingleCall, every client-call will be served by a completely new instance of your server object.
Rude
|
|
|
|
|
Is there any way to play .mp3 files using DirectX and C#? I've gotten it working with the Windows Media Player, sort of, but WMP is WAY to buggy to be reliable. For instance, some of my .mp3 files will play in WMP but others (made on the same day and in the same way) will not. However, all of my .mp3's play fine in MusicMatch, WinAmp and using the JMF, so the problem seems to be with Windows Media Player.
Anyway, I've added a reference for DirectX to my project but I have no clue what class to use to load and play the .mp3 file.
Thanks
|
|
|
|
|
I saw a nice piece of source at gotdotnet.com (look at bottom of page). The program is a small game called Deviate, you mite find what you are looking for here.
Hope this helps
READ MSDN
|
|
|
|
|
Well, that works fine for .wav files, but with .mp3's it just blows up. Is it possible that DirectX doesn't support mp3?
|
|
|
|
|
Hello!
How can I change my Windows Desktopwallpaper in C#? I need to see the result at once, so an refresh or so could also be nessesary, I don't know
Thanx for any help
Mario
|
|
|
|
|
Use the Registry class to modify HKEY_CURRENT_USER\Control Panel\Desktop\WallPaper
OR
Use the Windows API function SystemParametersInfo(). You'll have to DllImport it from user32 and lookup the constants in winuser.h
|
|
|
|
|
Help! I got stuck at the moment.
First I tried to change the registry value with:
RegistryKey key = Registry.CurrentUser.OpenSubKey( "Control Panel\\Desktop" );
if (key==null) listBox1.Items.Add("--- Key not there!");
else
{
listBox1.Items.Add(key.GetValue("Wallpaper"));
key.SetValue("Wallpaper","C:\\test.bmp");
}
With GetValue I get the correct actual Wallpaper-filename, but when trying to write with SetValue I get a System.UnauthorizedAccessException "Cannot write to the registry key"
----------------------------------------
Then I tried to call the Windows API function with:
[DllImport("user32.dll")]
public static extern bool SystemParametersInfo (long uiAction, long uiParam, string pvParam, long fWinIni);
(..)
bool ReturnValue=false;
ReturnValue=SystemParametersInfo(0x0014,0,"C:\\test.bmp",0x0002);
After the call, the ReturnValue is true and the screen updates (flashes). But the desktop-wallpaper is still the same.
The Bitmap "C:\\test.bmp" exists
Any idea?
Mario
|
|
|
|
|
Change all your longs to uint. You're passing 64bit values to a function that's expecting 32bit.
|
|
|
|
|
Thanx!
It works perfectly now (you immediately see the result). So for all who want to change the desktopwallpaper, the "final" code is:
[DllImport("user32.dll")]
public static extern bool SystemParametersInfo (uint uiAction, uint uiParam, string pvParam, uint fWinIni);
ReturnValue=SystemParametersInfo(0x0014,0,"FILENAME",0x0002);
Mario
|
|
|
|
|
I need to generate pdf dynamically, programmatically from an ASP.NET web form. I use C# for the code behind. I retrieve data from a SQL server database. I need to let a user on my web application have the option of generating a pdf document with this data, save it on a local drive or path of choice, and view it.
Thank you in advance..
|
|
|
|
|
I think Crystal Reports which comes with VS Enterprise Architect has PDF export functionality
|
|
|
|
|
Thank you. i will look into that..if u know any of the specifics involved in exporting CR to pdf do let me know..thanks a bunch..
Thank you in advance..
|
|
|
|
|
Check this out:
http://sourceforge.net/projects/pdflibrary/
It's officially in BETA, but I've been using it in one application for a little while now without problems.
Andrew Connell
IM on MSN
andrew@aconnell.com
|
|
|
|