|
|
|
Dears , Can any one tell me How i can use listbox in Datagridview using C#.net
|
|
|
|
|
Well you could have tried using Google; it took me less than one minute to find this[^].
|
|
|
|
|
Hi,
How to enable write permission for a folder , I googled internet for some sample programs, I got few programs but these were on the basis on Domain name and User name! I would like to know how this can be achieved on a standalone system ? Do we require Domain name and User Name for changing permission of a folder?
I have attached a small program of with this issue, kindly review it, it is executing but there is write permission is not enabled with this.
using System;
using System.IO;
using System.Security.AccessControl;
using System.Windows.Forms;
namespace FileSystemExample
{
class FileExample
{
public static void Main()
{
string DomainName = System.Environment.UserDomainName.ToString();
DomainName += @"\";
string AccountName = System.Environment.UserName.ToString();
DomainName += AccountName;
try
{
string folderName = @"C:\Inetpub\ftproot";
Console.WriteLine("Adding access control entry for "
+ folderName);
AddFileSecurity(folderName,DomainName,FileSystemRights.WriteExtendedAttributes, AccessControlType.Allow);
Console.WriteLine("Removing access control entry from "
+ folderName);
RemoveFileSecurity(folderName, DomainName,FileSystemRights.WriteExtendedAttributes, AccessControlType.Allow);
Console.WriteLine("Done.");
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
public static void AddFileSecurity(string folderName, string account,
FileSystemRights rights, AccessControlType controlType)
{
FileSecurity fSecurity = File.GetAccessControl(folderName);
fSecurity.AddAccessRule(new FileSystemAccessRule(account,
rights, controlType));
File.SetAccessControl(folderName, fSecurity);
}
public static void RemoveFileSecurity(string folderName, string account,
FileSystemRights rights, AccessControlType controlType)
{
FileSecurity fSecurity = File.GetAccessControl(folderName);
fSecurity.RemoveAccessRule(new FileSystemAccessRule(account,
rights, controlType));
File.SetAccessControl(folderName, fSecurity);
}
}
}
Mike
|
|
|
|
|
You can add write permissions for local groups as well. And i guess for the "BUILTIN"'s as well.
|
|
|
|
|
Hi,
Is there any sample program which can show how to changer permissions of a folder?
Mike
|
|
|
|
|
|
i am trying to do the task in which i want to remove the last character of textbox if there is not any matching item in autocompletelist.
|
|
|
|
|
What is the problem ? Where are you stuck ? It's very easy to do. Check the Substring method of the string class.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
///What is the problem ? Where are you stuck ? It's very easy to do. Check the Substring method of the string class. ///
This is not simple as u said.., (sorry)..,
because ...
i am trying to do the task in which i want to remove the last character of textbox if there is not any matching item in autocompletelist.
autocompletelist is called by a webmethod.., i think he has to put login in web method ..
PLZ Correct me if am wrong...
Thanks
Rajesh B
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
Rajesh Jalsa wrote: autocompletelist is called by a webmethod.., i think he has to put login in web method ..
Is this for a website ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
may be..,
because the question is sounds like ,this was related to webservice/web site..,
@ Question poster
clarify our doubt... !!!!!
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
I just realised you had jumped in. I thought the OP was saying. Well, I guess he's another who asks a question that's vague, then never replies when people try to help.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
hey rajesh thanks for rply
actually i m creating a window application
in which i m generating the auto complete source of a textbox from database
what i want to do is when user types in textbox if thr is no matching result then typed character should be removed and autocomplete dropdownlist appear again with the matching result.
i dont want to permit the user to type wrong entry
|
|
|
|
|
no it is not for a website, it is for windows application, thank you
|
|
|
|
|
thank u, its working now but the autocomplete dropdown list not coming when the last character removed
|
|
|
|
|
hey christian
sory for late rply
actually i m creating a window application
in which i m generating the auto complete source of a textbox from database
what i want to do is when user types in textbox if thr is no matching result then typed character should be removed and autocomplete dropdownlist appear again with the matching result.
i dont want to permit the user to type wrong entry
thanks for ur rply in advance
|
|
|
|
|
Could you handle that in the KeyPress event instead?
|
|
|
|
|
i m already using it on keypress event
thanks for rply
|
|
|
|
|
Try the following:
private void button1_Click(object sender, EventArgs e)
{
String s = textBox1.Text;
s = s.Remove(s.Length - 1);
textBox1.Text = s;
}
I think you got the solution.
|
|
|
|
|
How about textbox1.Text = textbox1.Text.Substring(0, textbox1.Text.Length -1 ); ?
However, if you read the other posts, we think he's writing a web app. He also doesn't seem to really want help, he's not posting back.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
no christian i want help, i have some problem with my internet connection thats why i m not able to rply,
n i m creating a window application
|
|
|
|
|
thanks for rply
ur code work fine
now when my last character is removed i want to show auto complete drop down again without pressing any key
can u help me with that
thanks in advance
|
|
|
|
|
Can you clear me the question? I am not understanding your question.
|
|
|
|