|
Over my head, Sir; (I upvoted you.)
Help people,so poeple can help you.
|
|
|
|
|
Search on the internet. You will get plenty of examples / samples for download.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
|
|
|
|
|
|
Hi guys,
I have the above exception that appears to me when executing my code:
protected void Page_Load (object sender, EventArgs e)
{
if (this.Request ["ActionButton"] == "Generate")
{
string Json = "";
SLSalariesCollection salaries = new SLSalariesCollection (this._Session);
salaries.Init ();
string fileName = @"D:\New Folder\MyXmlff.xml";
if (System.IO.File.Exists (fileName))
{
System.IO.File.Delete (fileName);
}
XmlTextWriter myXmlTextWriter = new XmlTextWriter ("D:/New Folder/MyXmlff.xml",System.Text.Encoding.UTF8);
myXmlTextWriter.Formatting = Formatting.Indented;
myXmlTextWriter.WriteStartDocument(false);
myXmlTextWriter.WriteStartElement("root");
myXmlTextWriter.WriteAttributeString("xmlns","urn:iso:std:iso:20022:tech:xsd:pain.001.001.02");
myXmlTextWriter.WriteStartElement("pain.001.001.02");
int j = 0;
DateTime Now = DateTime.UtcNow;
string datevir = Now.ToString();
Boolean batch = true;
foreach (SLSalarie salari in salaries)
{
j++;
Json = Json + "{succeed : 1}";
myXmlTextWriter.WriteStartElement("Salarié", salari.Matricule);
}
myXmlTextWriter.Flush();
myXmlTextWriter.WriteEndElement();
myXmlTextWriter.WriteEndElement();
myXmlTextWriter.Close();
this.Response.ClearContent();
this.Response.Write(Json);
this.Response.End();
}
the problem that the code is sometimes excuting very well,sometimes no and appear to me this fatal EXCEPTION.
I think that it is problem of refreshing my references.i did this.The first time, ok running very well,the second time EXCEPTION appears.
when doing breakpoints,the problem appears in the collection'initiation.How can I solve that?
also when reading about the class xmltextwriter,i know that i should treat that in my code c#.So do i should to add to my code to solve that?
Thank u very much for u help
hugs
|
|
|
|
|
Where does the exception happen? The message should tell you which line...
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Digital man: "You are, in short, an idiot with the IQ of an ant and the intellectual capacity of a hose pipe."
|
|
|
|
|
Hello,
The exception appears when initiating my collection always:
SLSalariesCollection salariers = new SLSalariesCollection (this._Session);
salariers.Init ();
also xmltextwriter,as I read in msdn it provides also an exception but i don't know how to treat it
ty
|
|
|
|
|
Then either the problem is in the constructor (which you don't show) or in the _Session class variable.
We would need the code for the constructor and / or the variable load.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Digital man: "You are, in short, an idiot with the IQ of an ant and the intellectual capacity of a hose pipe."
|
|
|
|
|
hi,
this is the code of my load :
protected override void OnLoad (EventArgs e)
{
try
{
_ApplyCacheStrategy ();
string pageTitle = this.PageTitle;
if (pageTitle != null && (
this.Title == null || this.Title == this.SessionData.PageTitleToOverride))
{
this.Title = pageTitle;
}
_AddCheckServerErrorScript ();
_AddJsReportingScript ();
if (this.RootToken == null)
this.RootToken = _GetRootToken ();
this._PageTask = new WEAppPageTask (this.PageTaskString);
WEAppPageAccess pageAccess;
pageAccess = GetAccess ();
WEAppCheckingAccessResult checkResult = _CheckPageAccess (pageAccess);
pageAccess = GetAccess ();
if (checkResult != WEAppCheckingAccessResult.AUTHORIZED_ACCESS && !_TryChangePageAccess (pageAccess, checkResult))
{
pageAccess = GetAccess ();
_PageAccessDenied (pageAccess, checkResult);
throw new BSCInvalidOperationException ("Method _PageAccessDenied must throws exception or aborts current thread");
}
pageAccess = GetAccess ();
if (pageAccess == null)
throw new BSCInvalidOperationException ("Null access");
if (pageAccess.AccessWeight > -1)
pageAccess.AccessWeight --;
pageAccess.PageAccessState = WEAppPageAccess.GetPageAccessState ();
this.PageAccessState = pageAccess.PageAccessState;
if (pageAccess.PageAccessClean == null)
pageAccess.PageAccessClean = new WEAppPageAccessClean (PageAccessClean);
Thread.CurrentThread.CurrentCulture = this.AppCultureInfo;
base.OnLoad (e);
if (this.BindablePage)
DataBind ();
}
catch (Exception exception)
{throw BSCExceptionPropagation.Throw (exception, MethodBase.GetCurrentMethod (), GetType ());}
}
ty
|
|
|
|
|
That code doesn't set your _Session variable...
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Digital man: "You are, in short, an idiot with the IQ of an ant and the intellectual capacity of a hose pipe."
|
|
|
|
|
Pierre besquent wrote: the problem appears in the collection'initiation
Then show us the collection constructor (and/or maybe its Init method) and show us when you create the _Session object.
|
|
|
|
|
Hi,
I create a class library for my application that contains (_Session).
Tha init method is very good built not have matter.It is seems in xmltextwriter exception
|
|
|
|
|
The problem might be that _Session object is null when you create the collection, so you would be passing a null reference to it, and the null reference exception is thrown into that constructor when you try to access one of the _Session members.
|
|
|
|
|
Make sure this._Session is not null.
This could be throwing the error.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
|
|
|
|
|
..and loose the hugging.
I are Troll
|
|
|
|
|
With:
[ when doing breakpoints,the problem appears in the collection'initiation.How can I solve that? ]
I think you meen this part of you code:
[
// Initiation de la collection
SLSalariesCollectio salaries = new SLSalariesCollection (this._Session);
salaries.Init ();
]
Did you check the value of 'this._Session' before initializing your collection?
|
|
|
|
|
I had problem with tracking some HTTP requests which are sent by browser.
And small investigation defined that no every tool show the truth. Who doesn’t have time to read too many text below – outcome is simple a uri of browser.
Goal
My goal was – send GET request on some click action, and after that immideately show next page,
And here I did not care about response, so goal only – request …
Two options were reviewed:
Send request with using possibility param src :
If you can think then I Can.
|
|
|
|
|
On which side do you want to track the request?
On the browser you would have to write some plugin - of course specific to the user's browser which means lots of work.
A server normally will do some logging for you.
|
|
|
|
|
I am writing an application that I want to give to customers.
What is the best solution to create a trail period of 1 month.My preferred method is to disable parts of the application that are critical to normal use of the program but aren't critical to its evaluation (like the ability to save your work, for example).and then send them an unlocking code unique to their computer when they register the full program.
I was thinking that if they are interested in purchasing the software I will give them a license key or something, to unlock the application.
After all I don't want a "Sorry, this program has expired" message to the user.It should disable some application controls after the period and enable when they register.Please help me someone...Many thanks for any advice
|
|
|
|
|
You could set a key in the registry containing date and time of first use, but this is not very secure.
A more secure method would be to use multiple (encrypted) keys and an encrypted file with the same data.
Activation should be done based on a client-server system, this system should check wether the company+key combination is valid.
After making sure it is valid, the key should be encrypted and stored in the register.
Checking for double activations (multiple pcs/companies/illegal use) is a difficult task, unfortunately I have no experience with this.
|
|
|
|
|
|
Create two versions of your program using conditional compilation - you can use #if PAIDVERSION ... #endif to keep the features you want people to pay for to yourself and your paying customers.
Anything else can be broken, usually quite easily - but if the features aren't there at all, then it obviously can't be "cracked".
Well - it's just a thought ...
Regards
Espen Harlinn
|
|
|
|
|
This is the approach I would use. I'm typically writing custom software for individual clients so this doesn't really apply to my work, but is definitely the approach I would use for a commercial product.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
|
Really thanks for the support everyone.Making two types of apps inside one msi(exe),Is that so professional?
Well,doesn't matter.Still i have a doubt.I thought of storing two ,three variables inside the app by making the settings strings in application properties in Visual Studio.
In VB ,you can simply write 'If(My.Settings == "0")
But how to do that in C#.There is now "my" in there...
|
|
|
|
|
>> Is that so professional?
No - create two different setup projects too, one for the demo, and one for the paying customers
>> 'If(My.Settings == "0")
Oh my, that's not what I proposed. The VB syntax would be
#If PAIDVERSION Then
stuff only available to paying customers
#End If
If you use something like If(My.Settings == "0") everything gets compiled into the executable. The idea was to totally remove those features from the demo version - that way nobody can "crack" your licensing scheme.
>> But how to do that in C#.There is now "my" in there...
in C# you have "this" - a reference to the instance of the current object - and it's also used for .Net extension methods
|
|
|
|