|
I had this same problem with Windows 7 beta, the problem was intermittent and I'm not sure what was causing it. Do you run Visual Studio as administrator?
The problem seems to have been solved since Windows 7 release candidate.
|
|
|
|
|
u can c z solutions to ma problem....& try zem....as zey said..lol
|
|
|
|
|
I have a simple C# exe. It internally has some calls to custom interop. I dont have any problem in executing it manually by either double clicking the exe or thru command prompt, everything works as expected. But the moment i launch it using windows scheduled task it always fails.
Is this a know problem with interop calls, when an executable runs thru scheduled task? it fails at the point where i make a method call on the interop object. BTW i am using W2K.
Any suggestion/solution?
Thanks in advance....
Hariharan.T
|
|
|
|
|
Maybe this is a security issue? Are you using the same user for the scheduled task, as for the manually execution?
Regards
Sebastian
|
|
|
|
|
Thanks for the reply...
i do use the same user, and its part of the administrator group.
Even i added it to few local security policy settings but didnt help. If you are aware of any security policy related to scheduled taks pls share..
Hariharan.T
|
|
|
|
|
Does your app write a log? This could be helpful to get the problem...
|
|
|
|
|
It has a log but doesnt help much, empty exeption
It doesnt fail where i create the actual COM component in the interop instead it fails when i make call using the interop object. FYI the object is valid and not null
Hariharan.T
|
|
|
|
|
What type of exception do you get? Did you took a look in the system event table?
|
|
|
|
|
Event table doesnt have any error neither in Security nor in System. Just found the exception has been suppressed in the log file. i am in the process of rebuilding it to get the exact exception.
Hariharan.T
|
|
|
|
|
Hi All,
Can u help me how to get current user IP Address for my Intranet Site,
I have tried with below codes but its not working when i place my page in
live server....
i)HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]
this is working locally when i place in server its showing default gateway
for that system
ii)Request.ServerVariables["REMOTE_Host"]
could you plz help me to fix my issue.
|
|
|
|
|
Try these
1. Request.Params["REMOTE_ADDR"]
2. Request.UserHostAddress()
3. Request.ServerVariables("HTTP_X_FORWARDED_FOR")
HTTP_X_FORWARDED_FOR would return an list of IP address if the client is accessing the website though a proxy server / gateway server. In such cases use the below code -
ip=Request.ServerVariables("HTTP_X_FORWARDED_FOR") ;
if (!string.IsNullOrEmpty(ip))
{
string[] ipRange = ip.Split(',');
int le = ipRange.Length - 1;
string trueIP = ipRange[le];
}
|
|
|
|
|
Hi,
maybe this[^] will help you.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Hi,
Iam using Ajax collapsible panel in my web page page (C# and Asp.NET),
In Master page iam using Script manager instead of using in every page,
If i use script manager in master page the callapsible panel is not working,
and i checked with anathor scenario by removing the master page and placing
the script manager in my page seperately that's working fine,
can u give any soln to fix my issue by using script manager in master page.
|
|
|
|
|
This question you should post in ASP.NET forum.
What is disadvantage of using ScriptManager in content pages?
I Love T-SQL www.aktualiteti.com
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
Hi,
Thanks for your reply,
if i use script manager in my content page's
Ajax Collapsible panel is not working that is the problem,
I tried by removing master page and added script manager seperately in my
page then it's working fine,
Hope this is clear for you!!
|
|
|
|
|
Hi
I have a grid with any number of rows. Each row has a picturebox drawn next to it.
The pictureboxes have context menu's assigned to them (5 menuitems).
Problem is, selecting an item from the contextmenu makes sender the contextmenu, so I don't know which row's picture box was right-clicked.
My code looks like this at the moment.
Declarations:
private ContextMenu[] mnuLamps;
I have a routine which creates the contextmenus's:
mnuLamps = null;
mnuLamps = new ContextMenu[dsSummary.Tables[0].Rows.Count];
for (int i = 0; i < dsSummary.Tables[0].Rows.Count; i++)
{
mnuLamps[i] = new ContextMenu();
mnuLamps[i].MenuItems.Add(new MenuItem());
mnuLamps[i].MenuItems[0].Text = "Receive";
mnuLamps[i].MenuItems[0].Click += new EventHandler(ReceiveSelected);
...
mnuLamps[i].MenuItems.Add(new MenuItem());
mnuLamps[i].MenuItems[4].Text = "Retract";
mnuLamps[i].MenuItems[4].Click += new EventHandler(RetractSelected);
}
When the pictureboxes are added to the form I have:
for (int i = 0; i < dsSummary.Tables[0].Rows.Count; i++)
{
...
picBox[i].ContextMenu = mnuLamps[i];
...
}
I then have ReceiveSelected, RetractSelected etc as:
private void ReceiveSlecetd(object sender, EventArgs e)
sender is of course menuitem, so I don't know which row it was.
I have thought of using
private void ReceiveSelected(object sender, EventArgs e, int TheRow)
and
mnuLamps[i].MenuItems[0].Click += new EventHandler(ReceiveSelected(mnuLamps[i], EventArgs, [i]);
so that I have access to the row, but I am having trouble doing the EventArgs and I am not sure I can use this code fiddling.
Thanks,
Nigel
|
|
|
|
|
Hi,
as you have separate ContextMenu objects for all the PictureBoxes here are two things you could do:
1.
store the PictureBox reference inside the ContextMenu.Tag
the Tag property can hold any object or value you choose, and isn't used by Windows, .NET or GDI; a lot of Controls have a Tag property, when available it is there for your convenience.
2.
Maintain a Dictionary mapping ContextMenu objects to PictureBox objects.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Hi Experts
How Make Paging of data in Datagridview.in C#.Net.
Dinesh Sharma
Thank U
|
|
|
|
|
Searching the articles before posting may help at times. Look I found something here[^].
|
|
|
|
|
Hi, I created a class library and wrote a function with the try {} catch { throw ;} finally {} manner. However I am not doing anything in the catch block, only throwing the exception. I am handling the exception the UI layer which is using that class library. I want to know the best approach to write the try block. If I use only try {} finally {} without catch block, does it good ?
Pankaj
|
|
|
|
|
Are you even allowed to skip catch? I dont think so.
If the method calling the Class library method handles the exceptions(even for the class library methods), you can avoid try-catch block in the class library method.
|
|
|
|
|
I can not avoid the try catch finally in my class library. Because I am doing file operation in the class library, that's why I have to open and working on the files and in the finally block I am closing the writer/reader/file.
Pankaj
|
|
|
|
|
Hi,
From the C# 2.0 standard:
There are three possible forms of try statements:
• A try block followed by one or more catch blocks.
• A try block followed by a finally block.
• A try block followed by one or more catch blocks followed by a finally block.
Alan.
|
|
|
|
|
You can use try/finally without the catch, but you have to think about why you are doing this. As you're not catching exceptions at the level that they are being thrown, you are storing up a lot of work for the higher levels. By this, I mean that you could catch the exception and do something meaningful with it, rather than relying on the UI reporting that there was an error.
For instance, we have a library that catches an error where the SqlConnection has become unavailable, and (in the appropriate catch), reconnects the SqlConnection before it attempts to process the SQL again.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
I do not want to use the try catch finally in the class library, however I am doing file operations in the class library. I open/read/write the file with the stream reader/writer object and have to close that reader/writer in the finally block. If any error occurs during the read/write operation then reader must be close, that's why I have to use the finally block to close the reader. Here is the code
public string ReadXmlNodeValue(string fileName, string xmlPath)
{
string retValue = "";
StreamReader sr = null;
XmlDocument doc = new XmlDocument();
try
{
sr = new StreamReader(fileName, Encoding.UTF8);
doc.Load(sr);
XmlNode element = doc.SelectSingleNode(xmlPath);
retValue = element.InnerText;
}
catch
{
throw;
}
finally
{
sr.Close();
sr = null;
doc = null;
}
return retValue;
}
Can I write the above code without try catch finally block and it will close the reader if any error is generated during the process ?
Pankaj
|
|
|
|