|
Pete O'Hanlon wrote: Finally, Main should be public, not private.
You'd have thought that, but the entry point is special and will still be found even when hidden away inside a private nested class:
class Program {
private class NestedClass {
private static void Main() {
Console.WriteLine("Hello");
Console.ReadLine();
}
}
}
Alan.
|
|
|
|
|
I have a nice set of C# solutions on my machine.
Solution A and B compiles a few exe and dll.
Solution C generates a couple of MSI with WIX (it gets it files from the output of the two other solutions).
It work well on my machine.
When I try to compile it with a TFS Build Server though things differ.
1 - all the exe and dll are going to a single folder
2 - as the files are not compiled in the same places wix cannot find the exe and libraries.
I can think of a few ways to fix this, but I can't help but wonder, what did I do wrong?
|
|
|
|
|
i want to know what is Gaussian blur of image how to do this.I am working on canny edge detection where i want to use Gaussian mask but i don't know mathematics behind it.
|
|
|
|
|
There is a good amount of hits on Google for Gaussian Mask[^]
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|
|
|
I am using WCF services with Thread Pool concepts in the application using Oracle Database. The application has a Scheduling Workflow, where there will be multiple Jobs scheduled at the same time. The expected behavior is that, once the scheduler is triggered, all the jobs should be started parallel and at the background, various process are run.
All the jobs are not started in parallel. Say for example, if there are 20 jobs scheduled, only 15 are getting started and remaining are struck.
It results in Oracle Connection request timed out error.
Options Tried:
As the application uses PerSession and Concurrency mode as Multiple. The binding is netTCPBinding. Tried this could have been a WCF Throttling issues. So modified the Throttling parameters as well. But still results in Oracle error.
Any help would be appreciated.
|
|
|
|
|
rajaron wrote: Say for example, if there are 20 jobs scheduled, only 15 are getting started and remaining are struck.
It results in Oracle Connection request timed out error.
That means that 20 connections are reading from the same tables? Or are they also writing to those tables?
|
|
|
|
|
Hello,
I'm working on a small project wich requires me to run some code as a different users , (not the windows users)
I.e. user starts the program and he/she is required to login first, then there allowed to run a piece of code.
My login code looks like this :
private bool Authenticate(string userName, string password, string domain = null)
{
bool authentic = false;
try
{
using (PrincipalContext context = new PrincipalContext(ContextType.Domain))
{
authentic = context.ValidateCredentials(userName, password);
}
}
catch (DirectoryServicesCOMException) { }
return authentic;
}
Wich works,
But i cannot execute the rest of my code.
I've tried to use Impersonation Class but it results in an "Catasthropic failure"
The code blow is how i use the impersonation,
it happends after a button_click event
using (new Impersonator(txtGebruiker.Text, txtDomein.Text, txtPw.Text))
{
string profile = GetProfilePath(txtProfiel.Text);
txtLog.Text = profile;
}
I think im using the impersonation wrong ,
Any tips or suggestions are welcome
Thanks in advance
|
|
|
|
|
If you have a problem using the code in an article, it's usually best to post the question to the message board at the end of the article[^], since the author of the article is the best person to help you.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
From your code that's posted with the question on the article;
string profile = dirEntr.Properties["profilePath"][0].ToString();
dirEntr.Close();
If the first line throws an exception, it'd be logical for the second line to fail. The first line contains multiple statements, which I'd prefer to see split over several lines (to accommodate debugging), like this;
object profilePath = dirEntr.Properties["profilePath"];
string profile = Convert.ToString(profilePath[0]);
It might be that the property "ProfilePath" doesn't return a value; you'd put a breakpoint there and step through it. As a sidenote, you did see the warning in the article?
Please note: The user context that initiates the impersonation (i.e. not the user context to which it is switched to) needs to have the "Act as part of operating system" privilege set.
|
|
|
|
|
Hi,
Please anybody knows how to convet the html file into XML file using C#. I need to convert whole html file into XML file.
Thanks...
modified 12-Dec-12 3:18am.
|
|
|
|
|
chittu dinesh wrote: Please anybody knows how to convet the html file into XML file using C#.
Yes I do.
chittu dinesh wrote: Its urgent.
I couldn't care less. It's not urgent to me. Never use it's urgent in a forum posting - we don't work for you so your sense of urgency is completely irrelevant.
The solution you are looking for is to use the HTML Agility Pack[^]. Bear in mind, though, that an HTML page may be so badly formed that it cannot be represented as XML.
|
|
|
|
|
Hi,
Thanks.
|
|
|
|
|
If it's valid XHTML, then it's already XML. If you mean translate it to a particular schema, you can do that with XSLT.
If it's typical Internet HTML, then it isn't valid XML, and you will have to construct some sort of state-based reader that makes reasonable guesses about what non-XML markup actually means (i.e. unclosed <li>s and <p>s, unmatched chevrons, tags with naked attributes, etc).
|
|
|
|
|
Any one can help me,and tell that how i create a windows login application,and run this login application when computer start like windows logon screen,,and i want to replace this windows logon application with my own,,plz help
Vipul
|
|
|
|
|
Sure, join Microsoft and join the Windows team. Maybe then.
You can't replace the Windows Login screen - it would represent a huge security hole if you could replace it with a fake login. Just think about it for a moment and you'll see why it's not possible.
|
|
|
|
|
|
I am working on windows mobile application in which i need to store a captured image from the camera in isolated storage without saving it in the camera roll.
I am able to store the captured image in the isolated storage but a copy of the captured image in also stored in the camera roll that i don't want ...please help
|
|
|
|
|
Hi guys.,
I had an grid view where i had placed an link button to print an report.In this button click event i need to call the SSRS report and need to get the output as pdf file.
I had used this below code,the code is running fine,but i'm unable to see the prompt to open/save pdf file.Plz reply ASAP.
protected void btnAuthenticateAndPrint_Click(object sender, EventArgs args)
{
try
{
LinkButton lb = (LinkButton)sender;
GridViewRow row = (GridViewRow)lb.NamingContainer;
Label lbOrderID = row.FindControl("lbOrderID") as Label;
int OrderId = Convert.ToInt32(lbOrderID.Text);
da = new SqlDataAdapter("Get_PODetails", con);
da.SelectCommand.CommandType = CommandType.StoredProcedure;
da.SelectCommand.Parameters.AddWithValue("@MPDI_ID", OrderId);
ds = new DataSet();
da.Fill(ds, "PO");
if (ds.Tables["PO"].Rows.Count > 0)
{
lblPOId.Text=ds.Tables["PO"].Rows[0]["MPDI_ID"].ToString();
lblVendid.Text = ds.Tables["PO"].Rows[0]["MVDI_ID"].ToString();
lblBranch.Text = ds.Tables["PO"].Rows[0]["MBRI_ID"].ToString();
lblDate.Text = Convert.ToDateTime(ds.Tables["PO"].Rows[0]["MPDI_Date"]).ToString("dd-MM-yyyy");
}
rs = new RSWebService.ReportingService2005();
rsExec = new REWebService.ReportExecutionService();
rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
rsExec.Credentials = System.Net.CredentialCache.DefaultCredentials;
rs.Url = "http://localhost/ReportServer/ReportService2005.asmx";
rsExec.Url = "http://localhost/ReportServer/ReportExecution2005.asmx";
byte[] Sendresults = null;
byte[] bytes = null;
string historyID = null;
string deviceInfo = @"<DeviceInfo><Toolbar>False</Toolbar></DeviceInfo>";
string format = "PDF";
string encoding = null;
string mimeType = null;
string extension = null;
REWebService.Warning[] warnings = null;
string[] streamIDs = null;
string _reportName = @"/FIMO GOF Assets Reports/PURCHASE ORDER";
REWebService.ExecutionInfo ei = rsExec.LoadReport(_reportName, historyID);
REWebService.ParameterValue[] parameters = new REWebService.ParameterValue[4];
parameters[0] = new REWebService.ParameterValue();
parameters[0].Name = "MVDI_ID";
parameters[0].Value = lblVendid.Text;
parameters[1] = new REWebService.ParameterValue();
parameters[1].Name = "MBRI_ID";
parameters[1].Value = lblBranch.Text;
parameters[2] = new REWebService.ParameterValue();
parameters[2].Name = "MPDI_Date";
parameters[2].Value = lblDate.Text;
parameters[3] = new REWebService.ParameterValue();
parameters[3].Name = "ReportParameter1";
parameters[3].Value = lblPOId.Text;
rsExec.SetExecutionParameters(parameters, "en-us");
Sendresults = rsExec.Render(format, deviceInfo, out extension, out encoding, out mimeType, out warnings, out streamIDs);
MemoryStream ms = new MemoryStream(Sendresults);
if (format == "PDF")
{
Response.ContentType = "application/pdf";
Response.AddHeader("Content-disposition", "inline;filename=output.pdf");
Response.AddHeader("Content-Length", Sendresults.Length.ToString());
}
Response.OutputStream.Write(Sendresults, 0, Sendresults.Length);
Response.OutputStream.Flush();
Response.OutputStream.Close();
}
catch(Exception Ex)
{
throw Ex;
}
}
|
|
|
|
|
|
I want to add labels to an image at different zoom levels like the one on google maps please give me some ideas.
|
|
|
|
|
WinForms? ASP.NET? WPF/Silverlight?
|
|
|
|
|
right now I am using winForms. but i can switch if u suggest any other.....
|
|
|
|
|
When the image zooms, simply use DrawText to paint the text directly onto the image (do this as part of the OnPaint cycle so that it refreshes when a repaint is requested). If you need a rectangle to surround it, measure the text first, then draw the rectangle slightly inflated, and finally draw the text in that rectangle.
|
|
|
|
|
thanks for the suggestion i will try it...
|
|
|
|