Just thread it. "net send" takes two or more parameters (besides switches) a single user or computername and the rest of the parameters are the message. There's no way around it.
Just use a worker thread (see the ThreadPool class), passing the user/computer name as the state variable and save the message to a member field. The thread execution method gets the username and gets the value from the message field and sends the message with "net send".
I'm writing an WinForm app in c# with VS2002 on win2000sp3 with mediaplayer9.
I have a Windows Media Player control that I added to my controlsbox
by going into the COM controls tab. This winmedplayer is embedded in the WinForm,
much like the 'Play' button, of course.
The problem I have is that whenever the application starts, it creates an exterior
Windows Media Player window that then loads the video and plays it in its own window.
My application just sits there behind with its own embedded media control that doesn't do
Here is the code for the load event of th app.:
privatevoid frmMain_Load(object sender, System.EventArgs e)<br />
string location;<br />
location = "C:\\Documents and Settings\\Administrateur\\Mes documents\\My Work\\Recherche et Developpement\\Videos et Audios\\Vidéo\\Q.AVI";<br />
So my question is: how may I play the video in the Windows Media Control that is embedded on my
Windows Form? -instead of having it played in a new Windows Media Player window independant of my app winform...
This by our hands that dream,
"I shall find a way or make one!"
I am trying to make a autometed image which will be image a new computer and add that computer domain. To do that I need to get avialble computer name from my database and change the current name and then add the computer to domain. I know how to add computer to domain but I don't know home to change the computer name. Can any one help me PL:
You can use SetComputerNameEx to change the computer name and NetRenameMachineInDomain to change the name in the domain. You can also simply call NetRenameMachineInDomain but you must supply a coputer name for the lpNewMachineName parameter.
That mite work on good ol' win9x, but it wont with any NT based OS, as you will have duplicate SID (see MCSE docs whereever they may be) on the network and the domain controller will refuse to use then. Maybe there is some other way, perhaps look at the the Deployment sections in one of the Resourse Kits. Good luck
I'm not totally sure if this will work (Graphics are not my strong point), but give it a shot:
System.Drawing.Bitmap b = new System.Drawing.Bitmap("filename.bmp");<br />
System.IO.MemoryStream ms = new System.IO.MemoryStream();<br />
b.Save(ms, System.Drawing.Imaging.ImageFormat.Wmf);<br />
System.Drawing.Imaging.Metafile m = new System.Drawing.Imaging.Metafile(ms);<br />
I'm sure other people will have a better solution, but I think that will get you started.
Be carefull by using this functions i thing that you are trying to convert an image form the raster format to vertor one so this prosess is not good to be done automatically you will get a file wich contain a data but not the correct data you want to deal with ... this converssion will produce a file with a point object for each pexile in the image so it is a meaningless information , i hoop that you cane use some softwares for degitizing like erdas or what ever....
the prove of my speaking that if you try that code you will get a WMF file but try to zoom in the picture you will get the pexiles rectangulars ....
Hello people, i'm having a big trouble with this thing of creating user, i developed a code to create users in Active directory and mailenable it, i always worked fine, (developer platform: Windows XP, IIS 5), but now the project is finished, and i passed it into production, so what appen:
(production platform: Windows 2003 server, IIS6)
Running as a console it works fine, no problem, but i need some part to run as a webservice, and boom it blows up on me. various error messages but the most consistent is "Catastrophic Error".
Here is a simple code that i'm testing now, attention this works fine in IIS 5, and Windows XP, but not in IIS6, all permissions is set and ok.
Also, the first thing that comes to my mind is permissions. IIS6 on Win2K3 (like it comes with anything else currently! ) starts making effective use of code access security. I really haven't had time to play with it, but I have spent a lot of time from the 1.0 beta days of CAS so all I can do is give you pointers.
Make sure that the web service is allowed to run with permissions appropriate to what you're doing. For example, invoking anything (DirectoryEntry.Invoke) requires the DirectoryServicesPermission so the web service must be granted that permission. How that's done for a web application in IIS6 is a bit of a mystery to me (if I ever have time to quite these constant last-minute changes from my PHB I will install it on our servers which need it anyway).
If it's not CAS, perhaps the Win2K3's membership doesn't grant it access to write to a AD?
Actually, I wasn't talking about AD permissions, per se. I was speaking of code access security (CAS) permissions. For instance, does the CreateMailbox method documentation say anything about a required permission to execute? It's a question of whether or not your web application has been granted the required permissions. This isn't necessarily through the machine.config file, either. If I remember correctly from the VS.NET 2003 / Windows Server 2003 launch event, you can grant permissions to web applications through IIS's administrative tool. I'm sorry that I don't remember specifics. I'm hoping I have a chance to purchase and install Win2K3 for our Internet-deployed application (touchless installation) for better security and availability.
Also, have you tried turning tracing on in your Web.config file and checking the app's trace log (trace.axd from the app root)? Does it give any more details or a stack trace that might point to the exact error? If its a catastrphic failure, of course, you might not get this.
You're running IIS as a domain admin?! Are you insane?!
Seriously, though: that is a really, really bad idea. You've just given any anonymous user a back door into your entire domain with the keys to every machine in the domain. Not good.
You've somewhat solved the problem though - it's about the permissions of the IIS user. Now you need to either add the normal user that IIS runs as (IUSR_MACHINENAME) to the appropriate groups and / or security rights, or have it run as a non-privileged user with the same constraints.
First, you are trying to use impersonation, but IIS / ASP.NET is throwing an error. Since this is a Win2K3 box, make sure the IIS user has the SeImpersonatePrivilege (configurable in the local machine (or domain, but that's too broad) policy). Next, make sure that the IIS user has permissions to your CDO server (SMTP Services for IIS, or Microsoft Exchange).
The whole idea is to find out what is wrong and make sure that the user that IIS runs under has the appropriate privileges and permissions. If you run as a privileged user you ultimately have all those things but at an extremely great cost!
It should be report alright but for me it's no problem because the iis is internal, and it's to host a webservice, this is is only to be used from another iis server that its published on the outside, and the calls are made by C# code, the code makes all the changes to AD, exchange, iis, filesystem and etc, it's a provisioning service, there by i need those admin privileges.
The machine it self is secure. so i believe that it's no problem.
I need to authenticate myself in the AD and iis webservice machine.