|
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
|
|
|
|
|
I have tried using the project u mention. It currently generates a single page pdf document. I was not able to figure out how to make multi page pdf documents with it..have u had any success in this regard??when i tried adding more text than a single page could hold it kind of ran out of the page..how do i tweak or add to the code to make it generate as many pages as necessary to hold the data??if you could please help me on this matter..i appreciate your time..
Thank you in advance..
|
|
|
|
|
Hmmm... never had the need... all my reports are one page. If I uncover anything I'll keep you informed.
Andrew Connell
IM on MSN
andrew@aconnell.com
|
|
|
|
|
Thank you...I appreciate your help and time..
Thank you in advance..
|
|
|
|
|
I'm trying to serialize a number of simple classes over socket, and it seems to work pretty good locally. I connect to the server, which sends me a simple text, which client prints, then I go into a loop on both sides where client initiates requests by creating objects of type "Request" (which I have defined) and serializing them over the socket.
The server then deserializes them, and creates an object of type "Response", which it then serializes back.
It all work very well, until I try connecting _from another machine_.
I get a connection, but the data just isn't sent (from server to client. I manage to send data from the client to the server).
I've tries serializing to memory and then sending the socket, but it seems to be incompatible (somehow) with just using a plain binaryformatter onto the networkstream.
Here's the server code:
private void SendResponse(Response p_response)
{
try
{
BinaryFormatter t_binaryFormatter = new BinaryFormatter();
NetworkStream t_networkStream = new NetworkStream(m_socket);
t_binaryFormatter.Serialize(t_networkStream, p_response);
}
catch (System.Exception e)
{
m_app.log(e, this);
}
}
(Works well locally, but not from another machine, both doing TCP/IP).
Alternative server-code:
private void SendResponse(Response p_response)
{
try
{
BinaryFormatter t_binaryFormatter = new BinaryFormatter();
MemoryStream t_memoryStream = new MemoryStream();
t_binaryFormatter.Serialize(t_memoryStream, p_response);
m_socket.Send(t_memoryStream.GetBuffer());
}
catch (System.Exception e)
{
m_app.log(e, this);
}
}
Works well even remotely for the first request, but after that I get this exception (in the client):
Exception: Binary stream does not contain a valid BinaryHeader, 0 possible causes, invalid stream or object version change between serialization and deserialization.
It seems there is superfluous data sent from the server when using the MemoryStream.
Any pointers? Thanks in advance.
Ideally, I would want to get it to work without using the MemoryStream.
|
|
|
|