|
First: this is no javascript forum
Second: search on google for an anwser
Third: here you go:
<head>
<script language="javascript">
<!--
function LoadMe()
{
self.close();
}
</script>
</head>
<body onload="LoadMe()">
<div align="center">
<a href="javascript:window.close()">Close</a>
</div>
</body>
|
|
|
|
|
My question is "How to catch browser close ?".
It's mean how can I detect press close button on the browser.
Thanks...
|
|
|
|
|
If your question is 'how can I detect press close button on the browser' you should question that in stead of 'how to catch browser close'.
And maybe I've allready given you the anwser: <body onload="LoadMe()">
I even wrote an implementation for you, but you're probably not interested in that.
|
|
|
|
|
Thanks for care Deresen.
But I try following script but, it's accept postback events...
<script type="text/javascript">
window.onbeforeunload = function()
{
window.open('Logout.html');
}
</script>
I must be foud diffirentation between browser close and "Postback".
Thanks again...
|
|
|
|
|
What is Generic Collection?
Why we use Generic Collection?
|
|
|
|
|
Generics are like lists.
You can store some defined typed data, and then make a lot of operations like a sort, find an item, remove / add items, extract all items, etc...
|
|
|
|
|
Are you faking some interview?????
Why dont you search it in the google...?????
Is it that hard to find????
There are million sites availing free tutorials on these topics.....
Have a Happy Coding.....
|
|
|
|
|
|
Collin Jasnoch wrote: Generic Collections (Array Lists) existed before non Generic (i.e. Lists).
You seem to have overloaded the word "generic"
The ArrayList is not a Generic object in the OO sense of the word. To remove the ambiguity you may like to call them "general" rather than generic.
Collin Jasnoch wrote: However you may have a situation where you want to maintain a collection of objects that are not necessarily the same object.
Did you mean "same type of object". I've never found a situation where I would repeatedly store the same object in a list.
|
|
|
|
|
|
"Generic Collections (Array Lists) existed before non Generic (i.e. Lists)"
Actually, lists (List <T>) are generic and array lists are non-generic. You either got them mixed up, Or you're using the term "generic" to mean "any type". In any case, .NET uses the term to mean parameterized types.
|
|
|
|
|
Collin Jasnoch wrote: The word generic or general is irrelevant
That is like saying "the word left or right is irrelevant". It isn't irrelevant. Generic has a very specific and well defined meaning in OO languages. If the OP used it in error then don't repeat the error. Use the correct term otherwise the OP will continue to use the word in error and cause more confusion later.
Collin Jasnoch wrote: FYI you could have a situation where you want to store the same specific object in a list. The list does not keep copies but actual references.
Are you trying to teach me C#? I am well aware of this. I just said I've never found a situation where I would want to do this.
Collin Jasnoch wrote: This is how you can keep ojects alive so the GC does not hit them.
Adding an object many times to the same list will not affect the way garbage collection works. Just one reference in the list is sufficient for the GC to ignore the object so long as the list itself is referenced.
|
|
|
|
|
Colin Angus Mackay wrote: Generic has a very specific and well defined meaning in OO languages.
I doubt that. It is rather difficult even to find an authoritative definition of "object oriented language".
But if you do have an authoritative definition then I would for one would like to see it.
|
|
|
|
|
Hi,
I'm a bit confused about how to use application settings in a C# .NET 2.0 application.
I have one project which is a console app and in that I have an App.config file with a couple of settings in it. My console app can access these settings using ConfigurationManager.AppSettings[<key name>] with no problems.
I've created a separate class library project, added a reference to it in my console application. I added a web service reference in my class library and a file, app.config has been automatically created which stores my web reference. However, in that file, there's no <appsettings> key, only an <applicationsettings> key.
I've tried using the the following syntax to allow my class library code to access the settings specific to the class library.
<setting name="MySetting" serializeAs="String">
<value>MyValue</value>
</setting>
...and...
<add key="MySetting" value="MyValue" />
Neither of these work, and I've just noticed that in my class library, there's also a Settings.settings item under the project Properties. I've tried setting the keys in there and still can't access them from my class library.
Any suggestions?
|
|
|
|
|
assumming that you have a guid added to your properties use the following
global::ClassLibrary1.Properties.Settings s = new ClassLibrary1.Properties.Settings();
Guid g = s.guid;
|
|
|
|
|
Thanks for your reply but I couldn't get that to work
I'm only using ints and strings in my config file though.
|
|
|
|
|
Hi,
i am opening Multiple word document using c#.but instead of opening
each document in seperate windows, every doc open in single window,
and by minimizing each we can look into the every document.
but i wanted to open every document in seperate document.(means in seprate word file).
|
|
|
|
|
|
I want to build a windows application that can send sms to the mobile. The message has to be fetched from a table of Sql server 2005 database. The sms should be sent in 2 ways-
1) Through sms gateway
2) Through H/W (modem,GSM etc.)
Please send me code for sending sms in C#.Net in both the above mentioned ways. Thanks in advance.
|
|
|
|
|
Sending some code ????
How about asking Mr. Google ...!!!
|
|
|
|
|
Please notice that this is not "getacoder" or "rentacoder" website.....
YOu may place your HUMBLE request there....
Have a Happy Coding.....
|
|
|
|
|
If you're going to be using an SMS gateway, your service provider will almost certainly have some sort of developer's guide. I've used an SMS gateway myself and I was able to download an excellent developer's guide which documented all the calls and even provided sample code. They also provided me with free credits to try the gateway out and a "test mode" which allowed me to test my code before I started actually sending text messages beyond the gateway.
So, in summary, speak to your gateway provider and at the risk of generalising, if they don't provide a decent development guide, look elsewhere
Evil cannot be conquered in the world... It can only be resisted within oneself.
|
|
|
|
|
i am a students, i am transform a code about lz77 decompression in c# from JSCRIPT
this is my c# code
public class lz77DeCompression
{
private char ReferencePrefix;
private int ReferencePrefixCode;
private int ReferenceIntBase;
private int ReferenceIntFloorCode;
private int ReferenceIntCeilCode;
private int MaxStringDistance;
private int MinStringLength;
private int MaxStringLength;
private int MaxWindowLength;
public lz77DeCompression()
{
this.ReferencePrefix ='`';
this.ReferencePrefixCode = (int)this.ReferencePrefix;
this.ReferenceIntBase = 96;
this.ReferenceIntFloorCode =(int)' ';
this.ReferenceIntCeilCode = this.ReferenceIntFloorCode + this.ReferenceIntBase -1;
this.MaxStringDistance = (int)Math.Pow(this.ReferenceIntBase ,2)-1;
this.MinStringLength = 5;
this.MaxStringLength = (int)Math.Pow(this.ReferenceIntBase, 1) - 1 + this.MinStringLength;
this.MaxWindowLength = this.MaxStringDistance + this.MinStringLength;
}
private int decodeReferenceInt(string words, int width)
{
int value;
int i;
int charcode;
value = 0;
for (i = 0; i < width;i++ )
{
value *= this.ReferenceIntBase;
charcode = (int)words[i];
if ((charcode >= this.ReferenceIntFloorCode) && (charcode <= this.ReferenceIntCeilCode))
{
value += charcode - this.ReferenceIntFloorCode;
}
/* else
{
Response.Write ( "<script type=\"javascript\">alert("+ charcode+")<//script>");
}*/
}
return value;
}
private int decodeReferenceInt(char words, int width)
{
int value;
int i;
int charcode;
value = 0;
for (i = 0; i < width; i++)
{
value *= this.ReferenceIntBase;
charcode = (int)words;
if ((charcode >= this.ReferenceIntFloorCode) && (charcode <= this.ReferenceIntCeilCode))
{
value += charcode - this.ReferenceIntFloorCode;
}
/* else
{
Response.Write ( "<script type=\"javascript\">alert("+ charcode+")<//script>");
}*/
}
return value;
}
private int decodeReferenceLength(char words)
{
return decodeReferenceInt(words, 1) + this.MinStringLength;
}
public string decompress(string words)
{
string decompressed;
int pos,distance,length;
int getSubString;
char currentChar;
char nextChar;
decompressed ="";
pos = 0;
while (pos < words.Length)
{
currentChar = words[pos];
if (currentChar!=this.ReferencePrefix)
{
decompressed += currentChar;
pos++;
}
else
{
nextChar = words[pos + 1];
if (nextChar != this.ReferencePrefix)
{
distance = decodeReferenceInt(words.Substring(pos + 1, 2), 2);
length = decodeReferenceLength (words[pos+3]);
getSubString=decompressed.Length - distance - length;
decompressed += decompressed.Substring(getSubString, length);
pos += this.MinStringLength - 1;
}
else
{
decompressed += this.ReferencePrefix;
pos += 2;
}
}
}
return decompressed;
}
}
and this the JSCRIPT code
//lz77 class
ReferencePrefix = "`";
ReferencePrefixCode = ReferencePrefix.charCodeAt(0);
ReferenceIntBase = 96;
ReferenceIntFloorCode = " ".charCodeAt(0);
ReferenceIntCeilCode = ReferenceIntFloorCode + ReferenceIntBase - 1;
MaxStringDistance = Math.pow(ReferenceIntBase, 2) - 1;
MinStringLength = 5;
MaxStringLength = Math.pow(ReferenceIntBase, 1) - 1 + MinStringLength;
MaxWindowLength = MaxStringDistance + MinStringLength;
function decodeReferenceInt(data, width) {
var value = 0;
for (var i = 0; i < width; i++) {
value *= ReferenceIntBase;
var charCode = data.charCodeAt(i);
if ((charCode >= ReferenceIntFloorCode) && (charCode <= ReferenceIntCeilCode)) {
value += charCode - ReferenceIntFloorCode;
} else {
throw "Invalid char code in reference int: " + charCode;
}
}
return value;
}
function decodeReferenceLength(data) {
return decodeReferenceInt(data, 1) + MinStringLength;
}
function decompress(data) {
var decompressed = "";
var pos = 0;
while (pos < data.length) {
var currentChar = data.charAt(pos);
if (currentChar != ReferencePrefix) {
decompressed += currentChar;
pos++;
} else {
var nextChar = data.charAt(pos + 1);
if (nextChar != ReferencePrefix) {
var distance = decodeReferenceInt(data.substr(pos + 1, 2), 2);
var length = decodeReferenceLength(data.charAt(pos + 3));
decompressed += decompressed.substr(decompressed.length - distance - length, length);
pos += MinStringLength - 1;
} else {
decompressed += ReferencePrefix;
pos += 2;
}
}
}
return decompressed;
}
//end class
when i give input input in c# code
input :
I'm just a little bit caught in the middle
Life is a maze and lov` ,"r` >!I don't know where to go I can't do it alone I've tried
And I don't know why
then the output :
I'm just a little bit caught in the middle
Life is a maze and love is a rddle
I don't know where to go I can't do it alone I've tried
And I don't know why
when i input in jscript
input :
I'm just a little bit caught in the middle
Life is a maze and lov` ,"r` >!I don't know where to go I can't do it alone I've tried
And I don't know why
then the output
output:
I'm just a little bit caught in the middle
Life is a maze and love is a riddle
I don't know where to go I can't do it alone I've tried
And I don't know why
the right output is in JSCRIPT, in c# there is missing one character
but when i try differen input :
in c#
input :
I'm just a little bit caught in the middle Life is a maze and lov` ,"r` >!I don't know where to go I can't do it alone I've tried And I don't know why
output :
I'm just a little bit caught in the middle Life is a maze and love is a riddle I don't know where to go I can't do it alone I've tried And I don't know why
in JSCRIPT
input :
I'm just a little bit caught in the middle Life is a maze and lov` ,"r` >!I don't know where to go I can't do it alone I've tried And I don't know why
output :
I'm just a little bit caught in the middle Life is a maze and love is a riddle I don't know where to go I can't do it alone I've tried And I don't know why
u can see, they have same output, and the both output are right ..
i am confuse about my program, i dont know where is the error, and what is the solution ..
i hope somebody here, can help me to solve my problem with that code ..
thank you very much ..
regards
novhard..
|
|
|
|
|
I hope that someone answers your request, but I doubt if they will. It is too difficult to read.
Edit your post.
Put the code between <pre></pre> tags, and format it properly, indentation and so on.
Differentiate the input and output from your question, maybe bold it, or italicise it, or both.
At the moment it is too difficult to work out what it is that you want!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
i am oredy solve the problem, thx for reply my message ..
|
|
|
|