Does anyone know how to change folder permissions on Windows XP using C#? My problem is that when my application is run under the restricted account under windows XP the folder
All Users Application Data has only read access. I want to add write access to that folder the first time the application is run. The application has to be run by an administrator first so I was hoping to do it then.
You could search for additional articles, as well as comments in this forum because it has been discussed several times before.
You probably shouldn't modify the ACL of the All Users directory, though. Users should not be able to write files to this directory. If you need the application to save files in a place where other users of the machine can access them, you should consider installing your program into C:\Program Files (where applications are supposed to go anyway) and use a folder within that. By default, most users can write to those directories. All Users is more for things like Start menu shortcuts available to everyone. Occassionally, net admins will put a README file in the Documents folder or something that user can't delete, but this is pretty rare these days with modern networks.
I am trying to insert a null value into a parameter value for a stored procedure. I set the IsNullable property to true, but it still will not execute the stored procedure unless I put something other than a null. Any ideas? Thanks.
I have web service application which have two session which have two method,which Sessionenable property is enable in both. In second one I check if the session is not null and I do something after it. When I test my application in the test page of web servise it runs OK but when I test it in a ASP.NET client application it is obvious that the Session is null and my connditions does not work in second web service. Any idea?
You must use a cookie container with each request. Sessions rely on storing a SessionId in a cookie. Without cookies enabled (or in this case, a container in which to store them), sessions won't work. Use the CookieContainer property in the Web Service class for your clients, inheritted from HttpWebClientProtocol). It uses a System.Net.CookieContainer. Instantiating a new one and assigning the property should do the trick. Just make sure you reuse the CookieContainer. So long as the Web Service class remains instantiated, you shouldn't have to do anything else.
Hi Heath,Thanks for your reply.I found it but I didn't want to mess up forum. One of my client will be VB.6 . Do you know ,does VB6 has this capability to set cookie container? I think there is no problem with that but I want to be sure.
Not sure about that. It depends on how VB6 encapsulates the Web service, which I'm not familiar with. I'm sure this is not a new problem, so you could always try googling for an answer. I'd check what the class that's generated from the SOAP SDK (or whatever you're using to generate the VB6 class) supports, too. If you would be so kind, could you reply to what you found? I'd be interested to know, too.
I test a VB.6 client. I didn't know that vb.6 use XML Web Service like this. It doesn't create web service class or so,it just create a MSXML2.DomDocument and send an url which contain web service method name and get a XMLMessage. Do not need to set any cookie container or something else, Sessions works without any additional things for VB.6.Just send a url request and you will receive correct data.
Is there a way to read the properties of a file on a http server?
I want to know when a specific file was modified, so I can make C# download it by itself when the local version is older than the one on the web.
Using the right properties on the Form class, you can implement the container/view part pretty easily. As for the doc/view part, there was a really good series of articles on MSDN[^] recently. See the following parts by Chris Sells about document-centric applications in Windows Forms using C#:
I've tried to display a MetaFile (saved as Image in a DB) in a pictureBox, using the Graphics.DrawImage(image, pictureBox.Bounds, img.getBounds(ref GraphicsUnit.Pixel), GraphicsUnit.Pixel) method.
The pictureBox Bounds are sizeable, so in step 1, the image is stretched smaller and everything's fine.
But in stept 2, the picturebox gets larger than the image and the method does not stretch the image.
Is there a possibility to resize the whole metafile?
I've tried it with a new Metafile on a System.IO.MemoryStream, but that doesn't work, even a new transformation of the e.Graphics surface didn't work by using e.Graphics.ScaleTransform().
Which does exactly what it says on the tin, but its not exactly what I am looking for as I dont want/need async/waitcallback threads. Basically I have an application that will start X mount of threads (X is dicatated by a config file) and these will continue to run until the application is shut down.
Does anybody know of a way of doing this?
Last Visit: 31-Dec-99 19:00 Last Update: 7-Feb-23 22:26