|
Hi,
I am using "ActiveDs" to assign rights to a shared folder
Code:
ADsSecurityUtilityClass objClass = new ADsSecurityUtilityClass();
string strSharedFolderName = "\\\\" +strMchnName +"\\" +strName;
Object obj = objClass.GetSecurityDescriptor(strSharedFolderName,(int)ADS_PATHTYPE_ENUM.ADS_PATH_FILESHARE,(int)ADS_SD_FORMAT_ENUM.ADS_SD_FORMAT_IID);
The last line is giving "Unspecified Error"
Can someone help please????
DDeepali
|
|
|
|
|
this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer,true);
I used the above code Flickering is not completely removed, still it’s slightly flickering. Is there any way to remove complete flickering of Waveform?
Whenever the form is resized or the horizontal scrollbar is moved, the waveform starts flickering... Please do help me...
|
|
|
|
|
You are probably trying to paint too much, try paint less when you scroll, and do a full repaint when u stop.
|
|
|
|
|
i have data table contains more than 90 column and i want easy and effective way to make the user easly handle it (read & write)
welcome for any suggestions
regards
|
|
|
|
|
Try to divide this table into sub-tables and establish relations between them (follow Normalization process).
After this you may use any grid control to show tables with parent child relationship.
This will be showing data in hierarchical representation, and make it very easy for users to look at it and modify it.
-Ajay.
-------------------------
www.componentone.com
-------------------------
|
|
|
|
|
how can Extract Link embedded file from word file using Application object.using C# coding.
|
|
|
|
|
|
Hello everyone,
Suppose I am using append mode to write to a file using StreamWriter. My application is a long run Windows service. I get the handle of StreamWriter only once during the start of my application by using StreamWriter abc = new StreamWriter (...). I never close the handle abc until application stops, and will use the handle to perform write operations in the runtime of the application.
I only write to the file rarely, for example, there may be no write operation for 2 days or something.
My question is, if I obtain the handle of the StreamWriter too long without any write operations (for example, 2 days or longer), will the handle (or the underlying file) be closed by some parties (e.g. CLR, OS, etc.) -- like timeout of socket?
thanks in advance,
George
|
|
|
|
|
i think Garbage Collector will destroy the object.
|
|
|
|
|
Hi Nouman,
Sorry I made a mistake in my original reply, the abc is a static member of my class. Will it be GCed?
Any updates to my original question?
regards,
George
|
|
|
|
|
No, it will not be garbage collected as long as you have a reference to it.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Thanks for your confirmation, Guffa!
regards,
George
|
|
|
|
|
That may depend on wether the file is local or if there is a network layer involved in accessing the file. If it's local, I see no reason why it wold be closed.
However, if you are writing to the file so infrequently, why are you keeping it open? Just open the file when you need to read it, and close it afterwards. That way you don't risk losing any data because the stream is not flushed when the computer crashes...
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Thanks Guffa,
1.
It is a local file. Why do you think there may be issues for network based file? For example scenario?
2.
The reason why I keep it open is, the content writes to the file depends on ad-hoc client request, if no request, no write operation, if many requests, I need write a lot of stuff. It is impossible to predict the # of request of clients.
regards,
George
|
|
|
|
|
2 - If your application crashes after some requests, you will loose all the text written for the previous requests.
|
|
|
|
|
Thanks N a v a n e e t h,
Each time I write, I will do a flush if the content contains important information. Any comments or updates to my original question?
regards,
George
|
|
|
|
|
George_George wrote: 1.
It is a local file. Why do you think there may be issues for network based file? For example scenario?
If the network connection gets dropped, i.e. hardware problems
George_George wrote: 2.
The reason why I keep it open is, the content writes to the file depends on ad-hoc client request, if no request, no write operation, if many requests, I need write a lot of stuff. It is impossible to predict the # of request of clients.
Ever heard of appending?
using (System.IO.StreamWriter sr = new System.IO.StreamWriter("filename", true))
{
sr.WriteLine("test message");
sr.Flush();
}
will append to the file, not create a new one.
Hope this helps
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hi Bob,
In your code, each time we need to write, we need to open the file, go to end (append mode) of the file and write, then close.
I think it is a waste if we write frequently -- we need to open only once and close only once if the file is not automatically closed by some parties for no operation in a long time -- this is why I asked this question about optimization of your code.
Any comments?
regards,
George
|
|
|
|
|
George_George wrote: My question is, if I obtain the handle of the StreamWriter too long without any write operations (for example, 2 days or longer), will the handle (or the underlying file) be closed by some parties (e.g. CLR, OS, etc.) -- like timeout of socket?
I don't think so. GC will reclaim the memory only when no references to that object. A better approach would be to open the file when required, write content and close it though.
|
|
|
|
|
Thanks N a v a n e e t h,
Sorry it is my mistake not to describe the whole situation correcly. The abc actually is a static variable, any comments or updates to my original question about whether file will be automatically closed if open too long without any operation?
regards,
George
|
|
|
|
|
George_George wrote: whether file will be automatically closed if open too long without any operation?
I don't think so, but I am not sure though. GC will collect the instance only when there is no one referring the particular object. Since you use a static variable, it's lifetime will be till the application domain unloads. So I guess there won't be any problem.
|
|
|
|
|
Thanks N a v a n e e t h,
Question answered.
regards,
George
|
|
|
|
|
hey im trying to make an app that will log in to facebook ,
im using the following method to establish connection and post my credentials:
<br />
public static void start_post(string strPage, string strBuffer)<br />
{<br />
byte[] buffer = Encoding.ASCII.GetBytes(strBuffer);<br />
<br />
HttpWebRequest WebReq = (HttpWebRequest)WebRequest.Create(strPage);<br />
WebReq.Method = "POST";<br />
<br />
WebReq.ContentType = "application/x-www-form-urlencoded";<br />
WebReq.ContentLength = buffer.Length;<br />
WebReq.Referer = "http://www.facebook.com/index.php?";<br />
<br />
Stream PostData = WebReq.GetRequestStream();<br />
PostData.Write(buffer, 0, buffer.Length);<br />
PostData.Close();<br />
HttpWebResponse WebResp = (HttpWebResponse)WebReq.GetResponse();<br />
Console.WriteLine(WebResp.StatusCode);<br />
Console.WriteLine(WebResp.Server);<br />
<br />
Stream Answer = WebResp.GetResponseStream();<br />
StreamReader _Answer = new StreamReader(Answer);<br />
reply = _Answer.ReadToEnd();<br />
Console.WriteLine(reply);<br />
}<br />
i get the following respond from facebook:
"sorry, we're not cool enough to support your browser. please keep it real with the following browsers: ...."
any idea how to work around this facebook check , as im sending same data as my IE agent i dont know what else will work , asking for your expert help.
thank you.
Net
|
|
|
|
|
udikantz wrote: as im sending same data as my IE agent i dont know what else will work
And just where do you set that? I dont see it anywhere in your code. Try again.
|
|
|
|
|
i set that in a the main class of the project
these are the parameters that i pass to the method , i chenged the email and password to something fake be it looks something like that:
start_post("https://login.facebook.com/login.php", "challenge=e7d654f99268a01kl94007be0e399755&md5pass=1&noerror=1&email=someemail@gmail.com&pass=coolpassword&charset_test=%E2%82%AC%2C%C2%B4%2C%E2%82%AC%2C%C2%B4%2C%E6%B0%B4%2C%D0%94%2C%D0%84");
Net
|
|
|
|