|
Ok I just parsed it my own way
<pre lang="c#">
object[] blah = soap.domainExists("domain.com", param);
bool success = false;
string msg = string.Empty;
ParseXml(blah, out success, out msg);
</pre>
<pre lang="c#">
static void ParseXml(object[] data, out bool success, out string message)
{
success = false;
message = "Failed to parse XML";
// Loop through objects
foreach (object o in data)
{
// We only care about XmlElement. Ignore the XmlAttribute
if (o is XmlElement)
{
// Get the innerText
string text = ((XmlElement)o).InnerText;
if (text.StartsWith("status_code"))
{
if (text.Replace("status_code", string.Empty).Equals("200", StringComparison.CurrentCultureIgnoreCase))
success = true;
}
else if (text.StartsWith("status_message"))
{
message = text.Replace("status_message", string.Empty);
}
}
}
}
</pre>
|
|
|
|
|
We are having issue with URL Rewriting, when we publish the code (in VS 2005).
In unpublished code it worked fine. But When we publish the code in following two cases:
1) By Putting the Global.asax file in root folder.
2) By putting the Global.asax file in App_Code Folder.
In First case, URL Rewriting is done for the first time, but when any post back is Occurred due to any Button click, the page is refreshed, and the Button click event is not called.
In Second case, every thing works fine except the URL Rewriting part, now URL is not rewritten on any page. But all postbacks occurred correctly.
We are currently unable to findout the reason for this behaviour. May be we are using session to store the value of lastURL (in Application_AcquireRequestState of Global.asax), and it could be possible that in unpublished code session is accessible but not in published code (any ideas). The code is given below(just for suggestion):
RewriteURL.Cs code:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
namespace WebURL
{
public class RewriteURL : IHttpModule
{
ManageCatSubCat objCat = new ManageCatSubCat();
public RewriteURL()
{
}
public void Init(HttpApplication application)
{
application.BeginRequest += (new EventHandler(this.Application_BeginRequest));
}
public void Dispose()
{
}
private void Application_Disposed(Object source, EventArgs e)
{
}
void Application_BeginRequest(object sender, EventArgs e)
{
string fullOrigionalpath = HttpContext.Current.Request.Url.ToString().ToLower();
if (fullOrigionalpath.EndsWith("/scrapoffers/selloffer"))
{
HttpContext.Current.RewritePath("~/sellofferdefault.aspx?OfferType=SellOffer");
}
}
}
}
Global.asax code:
<%@ Application Language="C#" %>
<script runat="server">
void Application_Start(object sender, EventArgs e)
{
}
void Application_End(object sender, EventArgs e)
{
}
void Application_Error(object sender, EventArgs e)
{
}
void Application_AcquireRequestState(object sender, EventArgs e)
{
string strLastURL = "";
string fullOrigionalpath = HttpContext.Current.Request.Url.ToString().ToLower();
if (fullOrigionalpath.Contains(".aspx"))
{
if (fullOrigionalpath.Contains("/sellofferdefault.aspx?offertype=selloffer") && fullOrigionalpath != strLastURL)
{
HttpContext.Current.Session["LastAccessURL"] = fullOrigionalpath;
HttpContext.Current.Response.Redirect("~/ScrapOffers/SellOffer");
}
}
}
void Session_Start(object sender, EventArgs e)
{
}
void Session_End(object sender, EventArgs e)
{
}
</script>
In web.config file:
<pre lang="c#"><system.web>
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="POST,GET" path="ajax/*.ashx" type="Ajax.PageHandlerFactory, Ajax"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
<remove verb="*" path="js.axd"/>
<add verb="*" path="js.axd" type="DC.Web.HttpCompress.CompressionHandler,DC.Web.HttpCompress"/>
</httpHandlers>
<httpModules>
<add name="rewriteurl" type="WebURL.RewriteURL"/>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="HttpCompressModule" type="DC.Web.HttpCompress.HttpModule,DC.Web.HttpCompress"/>
</httpModules>
</system.web>
How is how we are Publishing the Code:
Open the web project in VS 2005 and then Going to Build Menu and Click Publish Website submenu and giving target Location and Checking all the 4 checkboxes :1) Allow this Precompiled site to be updatable
2)Use fixed naming and single page assemblies.
3)Enable Strong Naming on Precompiled assemblies.
And when you will check this checkbox then Selecting the radio button Use a Key Container and Key Container text box is empty. And then checking the below checkbox.
4)Mark assemblies with allowpartiallyTrustedCallerAttribute(APTCA)
|
|
|
|
|
I'm dealing with what I think might be a bug in Visual Studio 2010 Professional. I have several forms in my application (WinForms, .NET 4x) which use a SplitContainer to provide a button panel (OK, Cancel, etc.) at the bottom of the form. I set the SplitContainer.FixedPanel to Panel2 and SplitContainer.IsSplitterFixed to true.
The form in question has SplitContainer objects nested 3 deep with DataGridView components in 3 of the panels and buttons in the 4th.
Now every time I press F6 to compile, the main parent SplitContainer.SplitterDistance is incremented by a value of 3. This happens with each F6 press until the components on Panel2 are being truncated on the lower edge of the panel.
I tried to duplicate the behavior by adding the same components to a new form. It wasn't until I added DataGridView components to some of the panels that the SplitterDistance of the main splitter component changed on compile. I'm guessing that the problem has to do with the complexity of the form and not with the DataGridView components specifically.
In general, I've had several problems with components not maintaining their positions during development. I can finish working on a form and return later to find everything moved around. Very frustrating
Has anyone else seen this behavior? Is there a workaround?
Thanks....
|
|
|
|
|
I've seen similar things even going back to VS 2002, but not that exact thing. And I don't know a way around it.
Can you reset the position in the Load method?
|
|
|
|
|
PIEBALDconsult wrote: Can you reset the position in the Load method?
I might be able to but having to position each component at run-time wouldn't be practical and I won't know for certain which components are mobile unless I check each component on each form with every compile.
|
|
|
|
|
Steve Harp wrote: Is there a workaround?
Make all your source-files readonly before building. As far as I can see, compiling does not modify the original sources - but if the window is open in the designer, then it might try to update it's contents in the Forms Editor.
Bastard Programmer from Hell
|
|
|
|
|
Eddy Vluggen wrote: Make all your source-files readonly before building. As far as I can see, compiling does not modify the original sources - but if the window is open in the designer, then it might try to update it's contents in the Forms Editor.
Your suggestion led me to another discovery. The value is incrementing when the IDE loads the form; not when it compiles. Apparently, the IDE reloads the form after a build and that's why I associated it with compiling. This is even worse because I can't very well change it to read-only as it's being loaded for editing. If I can't trust the IDE to load a form without modifying it, this means I have to check the position of every component on every form I edit before I save. This can't be right.
|
|
|
|
|
Steve Harp wrote: If I can't trust the IDE to load a form without modifying it, this means I have to check the position of every component on every form I edit before I save. This can't be right.
Is it the IDE that's modifying a property, or are is your code initializing some properties there?
I've seen quite some cases where the mere act of opening a form causes the damn thing to check-out and do all kind of weird things. It's usually an initialization-issue. DevExpress components will often show the same behavior.
Bastard Programmer from Hell
|
|
|
|
|
Eddy Vluggen wrote: Is it the IDE that's modifying a property, or are is your code initializing some properties there?
There's nothing in the code that would change the SplitterDistance property. The only properties I'm setting are BackColor, ForeColor, Font & ShowInTaskBar.
|
|
|
|
|
Are you sure that they don't affect the splitterdistance indirectly? A label with "autogrow" set to true might resize if another font is assigned.
Does it still happen if you don't set the properties?
Bastard Programmer from Hell
|
|
|
|
|
Eddy Vluggen wrote: Does it still happen if you don't set the properties?
Yes, it does.
|
|
|
|
|
Doesn't seem to be standard behavior; a splitcontainer on a form does not change it's position. Not on building, not on opening.
Any of the containing controls doing a resize? Anything resizing the form? Any code that references the inner panels and manipulates either height or width?
Bastard Programmer from Hell
|
|
|
|
|
Eddy Vluggen wrote: Any of the containing controls doing a resize? Anything resizing the form? Any code that references the inner panels and manipulates either height or width?
There is a resize method for the form but even when I comment it out, I still get the same behavior. I'm seeing this on multiple forms in the application (mostly more complex forms). The form in question has 3 Nested SplitContainer components where 3 panels contain DataGridView components. All the forms in the application are inherited from a master form that sets font, color, etc. as discussed above. I'm only noticing this behavior on the more complex designs (child forms with lots of complex controls).
Other than the form's resize method, the only other method that even remotely deals with resizing is that where of the DataGridView components calls it's AutoResizeColumns method.
|
|
|
|
|
My working environment:
Windows 7 Enterprise SP1, 64-bit OS, VisualStudio 2010 Premium.
My scenario:
I have a windows solution that needs to be published over a VPN to the “Live Server”.
When I publish the solution to the “Test Server”, it publishes fine, installs without problems, and the testers can do their stuff.
My problem:
When I publish to the “Live Server” over the VPN, the necessary files are copied over (the following files, where * represents the name of various classes, projects within my solution, etc: *.dll.deploy, the *.exe.manifest, the *.application, the *.exe.deploy) – 64 in total.
I have physically watched the copying process to verify that all the files are copied over.
The Publishing Folder Location and the Installation Folder URL are the same, as indicated on the Publish tab in the Properties of the Start-up project.
At the end of the copying, I get a VS error list with between 5-7 errors, and then a rollback starts that deletes those 64 files from the deployment location. Those errors ALWAYS include a combination of 9 specific files, and the files shown in the error list are not the same every time.
The error message:
“Failed to copy file ‘…filename…’ to ‘…deployment location…’ to the website. Unable to add file to ‘…deployment location…’ The specified network name is no longer available.”
While the copying took place, I pinged the “Live Server” with the –t tag to ensure that I can spot a drop in connectivity.
My request:
Is there anyone that can assist me, or point me in the right direction to sort out this problem? Is there something that I am overlooking? Any advice will be highly appreciated.
I am thinking of:
Since nothing changes between be publishing to the “Test Server” and the “Live Server” except for the deployment folder location, can I plainly copy the 64 files from the “Test Server” over to the “Live Server”?
Thanks in advance.
|
|
|
|
|
how we create treeview and its data base in c#.plz send me coding
|
|
|
|
|
And what type of TreeView? Is it a web application? Or is it a WPF app? Win Forms? What type of database?
You do realise that the forums aren't for asking for people to send you complete code solutions don't you? The accepted form here is that you write your own code, and when you have a problem you post a question with a relevant snippet of code, along with a detailed explanation of what the problem you are having is, what you have tried so far, and any relevant exception information.
As Code Project has a large number of articles, it's a good idea as well to search through the articles looking to see if there is anything in there that you could learn from. They generally have complete applications, and they are also rated so you can get a pretty fair idea what people think of them so that you can determine whether or not you should put much trust in the article content.
|
|
|
|
|
Noone is going to "send you coding" because we're not in the business of writing your code for you.
If you can't create the database on your own, according to your own business model, there's really no reason to start writing any C# code because there's no database to write code against!
|
|
|
|
|
Here's the code for a view of a tree:
.oo689ou.
98O9PS9689P
S9968D8O886'
`9O89S9889'
``|&|''
|%|
|%|
.:%:. mh
I hope that's useful
*ascii art source[^]
2A
|
|
|
|
|
I feel bad about voting 5 here. It definitely fulfils the treeview part, but isn't c#. This should sort out all the requirements :
{int i=9;}
bool l=true;
{l=l&&l&&l&&l;}
bool k=l||
l||
l||
l||
l||
l&l||l;;
|
|
|
|
|
Your version is certainly better
P.S. Oh, wait, we forgot the database . Back to the drawing board...
2A
|
|
|
|
|
Lyuben Markov wrote: Oh, wait, we forgot the database
|
|
|
|
|
Hi,
last year i develop a software in c#(WPF) so i deployed it and install to the employees machine with the name softbase2011 now my company need the same software but with the new name softbase 2012and just change the graphic interface and the string of the database (because each year they use a new database because they change price and data ,it is a travel agency) but they wish keep and use also the old software (softbase2011) so when i deploy the software softbase2012 i can not install it because appear an error that advice already there is a software with the same name installed on the computer then i ask you how i can install 2 softwares just changing the name on the same computer???
Thanks so much for your attention .
Cheers
|
|
|
|
|
If one is called softbase2011 and the new version softbase2012, then there should be no conflict. You need to investigate where the duplication exists, and correct it.
|
|
|
|
|
hi Richard,
that's strange it says already there is a version installed on the computer but in reality the version installed is softbase2011 so i don't understand why derosn't allow me to install the new version changing the name of the app.
thanks so much for your response
|
|
|
|
|
VisualLive wrote: it says already there is a version installed on the computer but in reality the version installed is softbase2011
Well some element or value that you are using has the same name in both versions so you need to investigate to discover which it is.
|
|
|
|
|