|
Hello everyone,
I am working in C#.NET environment.
In project some swf files has been displayed to only logged in users , and this swf files displayed by the coding.
But in testing face my testing team informed me that they are able to access those swf files without logged in. When I asked them about the process. Then they told me that First they read my source code from the browsers view source page. After reading the source they got the full path of swf files.
They simply copy that path and past on to the browser. And really I follow this step and able to see that swf files.
For protect this swf files I gone through all the settings of my site. And remove the read permission to swf files folder. And tested I got success now without logged in users are not able to view those swf files but when user logged into the site and request to view those swf files then that users is not able to view the swf files.
Now please tell me that I can denied those users to see my swf files who are not logged in.
Thanks.
Kunal Sagwaria
|
|
|
|
|
Hi,
I have a user control containing a toolstrip. I then want to derive this control. Is it possible to set the toolstrip so that I can modify it's buttons in design time in the derived user control?
Thank you
|
|
|
|
|
Hi,
The whole code works fine.
Except, when i decalared the instance of type ns1 within mystruct, the error "cannot have instance field initializers in structs" is produced. What is the reason benind this? Why we can not create instance fields in structs? while we can do that in classes.
And also, i didn't understand the term "instance field initializers".
public struct mystruct
{
public void display()
{
System.Console.WriteLine("My main Sturct");
}
public struct ns1
{
public void show(int n)
{
System.Console.WriteLine("nested struct 1: Call# " + n);
}
}
<code>
}
its used as follows:
mystruct ms = new mystruct();
ms.display();
mystruct.ns1 a = new mystruct.ns1();
a.show(1);
mystruct.ns1[] b = new mystruct.ns1[2];
b[0].show(2);
b[1].show(3);
_____________________________
Success is not something to wait for, its something to work for.
|
|
|
|
|
First of all, the field initializer is the bit that states "= new ns1[2];". This is not allowed because structs are value types.
You could use a constructor though (but not a parameterless constructor - structs don't support them):
public struct mystruct { <br />
public mystruct(int amount)<br />
{<br />
stary = new ns1[amount];<br />
}<br />
public void display() <br />
{<br />
System.Console.WriteLine("My main Sturct"); <br />
} <br />
public struct ns1
{ <br />
public void show(int n) <br />
{ <br />
System.Console.WriteLine("nested struct 1: Call# " + n); <br />
} <br />
}
public ns1[] stary;<br />
}
Arthur Dent - "That would explain it. All my life I've had this strange feeling that there's something big and sinister going on in the world."
Slartibartfast - "No. That's perfectly normal paranoia. Everybody in the universe gets that."
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Millions of Thanks
_____________________________
Success is not something to wait for, its something to work for.
|
|
|
|
|
its all good the only thing that i did not get is the parameter amount from where it gets the value as the declaration
public ns1[] stray
does not sending any value.
|
|
|
|
|
To specify the size, you would use:
mystruct superStruct = new mystruct(10);
This initialise the size of the array to 10. Strictly speaking, this is not good practice because you have put a dependency on the constructor - if you add another constructor, you will need to add this to that constructor as well.
A better approach would be to use a property for the array, and use the following:
public ns1[] MyArray<br />
{<br />
set {<br />
if (stray == null)<br />
stray = new ns1[2];<br />
... any other processing you want to do...<br />
}<br />
}
This clearly shows the benefits of encapsulation, and why it is generally good design practice to declare fields as private, and then use properties to get/set values. (Yes, I know that there are some cases where it makes sense to use public fields but, you should always look to private/protected fields first and then make them public only when you have decided that it makes sense to do so).
Arthur Dent - "That would explain it. All my life I've had this strange feeling that there's something big and sinister going on in the world."
Slartibartfast - "No. That's perfectly normal paranoia. Everybody in the universe gets that."
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi,
I need to open a File Open Window (browsing a file open dialog) in from my C# ASP .NET code. But I don't know which class/method to use.
Please, could you help me with this problem?
Thanks in advance
|
|
|
|
|
Hi
there is a control in ASP.net -- "FileUpload"
<asp:fileupload id="FileUpload1" runat="server">
May be i m not spaecific too ur requirement
Regards
|
|
|
|
|
<asp:FileUpload ID="FileUpload1" runat="server" />
|
|
|
|
|
use the FileUpload control for browsing a file.
sAqIb
"Our scientific power has outrun our spiritual power. We have guided missiles and misguided men."
Dr. Martin Luther King Jr.
|
|
|
|
|
Hi All!
I develop some kind of serial port logger app, and I need to test id witouth the target device. I have sample output in a text file from the device.
How can I do the test?
Sombody know some port emulator, witch read from file, and send tata, or can I do some loopback somehow?
Thanks for help!
|
|
|
|
|
Hi all,
I'm not sure what is wrong with the following code:
ListViewItem _numItem = lvNumberChekker.Items.Add("klkl");
the error underlines the "lvNumberChekker.Items.Add" part and it says: Cannot implicitly convert type 'int' to 'System.Windows.Forms.ListViewItem'
I've done pretty much the same thing on another section and it works fine.
please help
Thank you in advance
Nico
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
Hi,
I think it should work. Are you sure lvNumberChekker is really a ListView (if its a ListBox the message would make sense)?
Robert
|
|
|
|
|
Thank you, That was exactly it. I through a CheckedListBox onto my form without realizing it. Thank you, i changed it to a ListView with checkboxes.
I completely missed that one.
Thanks.
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
hi
i want write program same as Babylon Dictionary to get text when click middle mouse ?
i want to know that i should use OCR or i can use user32.dll and .net function...
please help me
tnx
Mory0Tiki
|
|
|
|
|
on double click any text get selected automatically(it's windows default behaviour).and you can get that selected text.hope it'll solve your problem
sameer
|
|
|
|
|
txn for your post but i want use whitout click and use that text in my program like Babylon your solution when i want get button ,menu ... don't work because when i get button's text ,button will be clicked ...
Mory
0
Tiki
|
|
|
|
|
Hi,
I would like to assign F10 some code, but I notice that F10 activates the Main Menu. Is there a way to stop F10 from doing this?
if(e.KeyValue == 121)//F10
{
//Do something
}
Thanks,
Ron
|
|
|
|
|
It's generally bad practice to remap the standard function keys and shortcuts. This can end up confusing your users. Imagine if pressing F1 invoked copy instead, and Ctrl+C invoked help - people would soon complain.
Arthur Dent - "That would explain it. All my life I've had this strange feeling that there's something big and sinister going on in the world."
Slartibartfast - "No. That's perfectly normal paranoia. Everybody in the universe gets that."
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
write your code in KeyPress event and after writting your code write e.Handle=true;
sameer
|
|
|
|
|
|
how to create nested structure which has an array of structure inside it.
thanks.
|
|
|
|
|
Something like this should help:
public struct MyClass<br />
{<br />
public int MyInt;<br />
private struct MyStruct2<br />
{<br />
public MyClass[] MyClasses;<br />
}<br />
}
Arthur Dent - "That would explain it. All my life I've had this strange feeling that there's something big and sinister going on in the world."
Slartibartfast - "No. That's perfectly normal paranoia. Everybody in the universe gets that."
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
how to create array of elements of structure for the outside array and how can i set the inner structure array to consist 10 elements for which i got the errors.
pls help,
thanks.
|
|
|
|