|
Actually with windows forms application filecopy works,then why not for the windows service
Amit
|
|
|
|
|
Is your service running under the local account? If yes, it cannot access network paths irrespective of your current login.
You will have to set up your service to use a Windows account that has access to the network path in question.
Cheers,
विक्रम
And sleep will come, it comes to us all
And some will fade and some will fall
|
|
|
|
|
ya thank u very much vikram
i also searched on the web and found 2 rticles which solved my problem completely
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=249102&SiteID=1
&
http://support.microsoft.com/default.aspx?scid=kb;en-us;827421#appliesto
so finally i changed code in installer
SrvPInstaller.Account = ServiceAccount.User ;
SrvPInstaller.Username = "";
SrvPInstaller.Password = "";
and while installing the service it asked me the user id and password where i i/p my uid and pwd which had the rights for that network shared directory
Amit
|
|
|
|
|
Hi friends,
I am using C# in windows based application and i am using one text box in which i want to validate the text box when user enters any Positive Values(+),Negative Values(-) and Decimal Values(.)(only Numeric Values).Can any one send me the code for validating the text box in windows based application using C#.
hemanth@919866357142
|
|
|
|
|
There's at least one article on this site that does that, there's also the maskedtextbox if you prefer. You just handle the keypress event, and set it's handled property to reject keys you don't want. Don't forget to check for Char.IsControl.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Why dont you use "NumericUpDown" control, its what, you want from a textbox
Becoming Programmer...
|
|
|
|
|
Thanks xmen_xwk for your message..but i cannot use NumericUpDown Control here because i want to enter any value in the text box(negative,Positive,Decimal Values from 1 to.... so i cannot specify all these numbers in the NumericUpDown control)..
hemanth
|
|
|
|
|
Use the code below.
Pass the textbox.Text to this method from the validating or validated or leave event of the textbox
public bool IsNumeric(object expression)
{
double retNum;
return Double.TryParse(Convert.ToString(expression), System.Globalization.NumberStyles.Integer,System.Globalization.NumberFormatInfo.InvariantInfo,out retNum );
}
Thanks,
Srikanth
|
|
|
|
|
Thanks Srikanth for your code.i tryed it but i didn't get the correct result from your code.can u send me the project file which you did to my mail id .I will check it out..my mail id is g.hemanth17@gmail.com
Thanks,Hemanth
|
|
|
|
|
buddy you can also write any value in NumericUpDown
Becoming Programmer...
|
|
|
|
|
hi!
i have used this chunk of code for taking only positive decimal and interger values, it worked successfully for me. you can modify it according to your need. it is basically keypress event of textbox...
private void onKeyPress(object sender, KeyPressEventArgs e)
{
char[] myNum = new char[12] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '\b','.' };
bool blnNumFnd = false; //for keeping track of decimal
foreach (char c in myNum)
{
if (e.KeyChar == myNum[11])
{
String txt = ((TextBox)sender).Text;
if (!txt.Contains("."))
{
blnNumFnd = true; //means its decimal value and user can't enter another decimal again!
break;
}
}
else if (e.KeyChar == c)
{
blnNumFnd = true;
break;
}
}
if (!blnNumFnd)
e.KeyChar = '\0';
}
hope it will work for you!
Regards,
shazjazz
|
|
|
|
|
Thank you shazjazz..its helped me out...
<marquee>hemanth
|
|
|
|
|
Hi Shanjazz can u send me the code for entering Positive values and negative values also..i tryed by changing the code but i didn't get the result correctly.I am waiting for your code for entering Negetive,Positive,Decimal values in textbox
hemanth
|
|
|
|
|
I created a grid which shows categories. I want to add paging to grid showing only 10 categories for each page.
According to requirement, first categoryid column of grid must be invisible. And want to replace y with yes. To achieve this I have written code as below
protected void gdViewCategory_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.DataItem != null)
{
e.Row.Cells[1].Visible = false;
if (e.Row.Cells[4].Text == "y")
e.Row.Cells[4].Text = "Yes";
if (e.Row.Cells[4].Text == "n")
e.Row.Cells[4].Text = "No";
}
}
And to add paging I have written code as below:
protected void gdViewCategory_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
gdViewCategory.PageIndex = e.NewPageIndex;
BindData();
}
It displays required result, but the header of gridview shows all column names.
And therefore row data is not under right columns.
|
|
|
|
|
Hi,
Have you Un-check Auto Genrate Fields Option.
Tri if it shaws all the Columns after customizing.......
Thanks
|
|
|
|
|
i need to use the namespace Microsoft.Office.Interop.Outlook.
For that when i searched in google regarding which dll to be referred i came to know that when Microsoft Outlook 11.0 object library dll is referred,
two dll(Microsoft.Office.Interop.Outlook and Office.Core) will automatically get refernced.
When i tried both dll are getting automattically added to the project but still i couldnt use Microsoft.Office.Interop.
Please help me out.
Thanks,
Srikanth
|
|
|
|
|
|
Aiyo!! i have the ssembly. Infact i have added the reference in my project.
Microsoft oulook 11.0 object library.dll which inturn refer MicroSoft.Office.Core and Microsoft.Office.Interop.Outlook assemblies.
But i couldnt use the namespace Microsoft.Office.Interop.Outlook namespace in my code.
And for your information google is available in India and we know how to get the stuff from google.
Thanks for your reply.
Thanks,
Srikanth
|
|
|
|
|
Christian Graus wrote: Is google blocked in some countries ?
No. But some people have a block in thier brain (mental block) which causes them to shirk doing homework and put dumb questions in our discussion boards. How many times we have to remind them to read ForumGuidelines before posting.
Did you observe Survey forums on Monday? There were hilarious code questions there!
|
|
|
|
|
Deepak,
i am not the person who is lazy to do the work and just ask for help blindly. i just had a problem in using a namespace.Asked for the reason.
I never ask just like that i need code for implementing this that.
Thanks,
Srikanth
|
|
|
|
|
Hi
How To Start Service After Install Setup Program
Thanx
|
|
|
|
|
you have tom use "System.ServiceProcess.dll"
using System.ServiceProcess;
Now use ServiceControler class to strat or stop any services !!!
e.g
<br />
ServiceController iis = new ServiceController("W3SVC");<br />
iis.Refresh();<br />
iis.Start();<br />
ucan check status of services using
<br />
ServiceControllerStatus.Stopped <br />
|
|
|
|
|
Hi,
I want to filter non numeric characters in one of my text boxes (windows form). I used following code for that.
________________________________________________________________________________________________
if ((e.KeyCode >= Keys.D0 && e.KeyCode <= Keys.D9) ||
(e.KeyCode >= Keys.NumPad0 && e.KeyCode <= Keys.NumPad9) ||
(e.KeyCode == Keys.Back) ||
((e.KeyCode == Keys.Oemcomma || e.KeyCode == Keys.OemPeriod || (e.KeyCode == Keys.Decimal)) &&
(txtNetAssetValue.Text.IndexOf(",") == -1 && txtNetAssetValue.Text.IndexOf(".") == -1)))
________________________________________________________________________________________________
I could filter all the non-numeric characters except "!@#$%^&*()_+" .
Can you tell me the group they belonging?
Thanks!!!
jayasshc
|
|
|
|
|
try Char.IsNumeric and Char.IsControl and then add your check for decimal characters.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
How can I get first clicked button’s image and second clicked button’s image in runtime application.
(I built the buttons automatically by coding in form loading. I will use tag of button’s image but I can’t define first clicked button’s ... and second clicked button’s.....For example I want to show “perfect” in messagebox if first clicked button’s backgroundimage is the same to second Clicked Buton’s backgroundimage. How can I write first clicked..... and second clicked ..... by coding to compare)
|
|
|
|