|
but the folder will also have confidential documents such as contracts and warning letters for employee and giving read only access will allow users to view every file stored in it.
Technology News @ www.JassimRahma.com
|
|
|
|
|
You don't give the users the permissions to view the folder by default. Instead, have a server based application or a Web API retrieve the documents and have that with the appropriate permission. Then you back this up with access control for the user against that service.
This space for rent
|
|
|
|
|
Create a folder for specific document types, employee photos, contracts, correspondence etc
Or do as POH suggested and create a service, this is the preferred method as it removes the client access directly to the server. However this would require you to reengineer you data access
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi!
I am able to send text messages to android using Google GCM by C# code.
But I am unable to send Images along with the text message.
Can anyone help in the same with some code.
--------------------------------
My code for sending message:
RegId = Id;
SENDER_ID = "1234567";
ApplicationID = "Google ID";
var value = txtnotofication.Text;
WebRequest tRequest;
tRequest = WebRequest.Create("https://android.googleapis.com/gcm/send"); tRequest.Method = "post";
tRequest.ContentType = "application/x-www-form-urlencoded;charset=UTF-8";
tRequest.Headers.Add(string.Format("Authorization: key={0}", ApplicationID)); tRequest.Headers.Add(string.Format("Sender: id={0}", SENDER_ID));
string postData = "collapse_key=score_update&time_to_live=108&delay_while_idle=1&data.message= {\"message\" : \"demo msg\",\"imgUrl\": \"http://justcash.co.in/img/logo0011.png \"}&data.time=" + System.DateTime.Now.ToString() + "®istration_id=" + RegId + "";
Console.WriteLine(postData);
Byte[] byteArray = Encoding.UTF8.GetBytes(postData);
tRequest.ContentLength = byteArray.Length;
Stream dataStream = tRequest.GetRequestStream();
dataStream.Write(byteArray, 0, byteArray.Length);
dataStream.Close();
WebResponse tResponse = tRequest.GetResponse(); dataStream = tResponse.GetResponseStream();
StreamReader tReader = new StreamReader(dataStream);
String sResponseFromServer = tReader.ReadToEnd();
tReader.Close(); dataStream.Close();
tResponse.Close();
|
|
|
|
|
See the answer to this[^] SO post.
/ravi
|
|
|
|
|
How to run the project with modules compiled on different platforms x86 and x64
or whether it possible to make a reference from x86 module to x64 attached DLL?
Actually there is no problem with compilation and assembly, but cannot run because of the following error
"An attempt was made to load a program with an incorrect format"
I'm aware that there is no way to run modules with different platforms in one process, but may be I can somehow reflect the methods from the dynamically linked DLL?
modified 22-Jul-16 3:59am.
|
|
|
|
|
Do you have the source to the 'modules'? If so, just building them against 'Any CPU' should do the trick.
Regards,
Rob Philpott.
|
|
|
|
|
I need exactly x64 or ...
may be there is the way to use large arrays up to 2GB on x86 platform ?
|
|
|
|
|
No, you cannot mix 32 and 64 bit code in the same application.
|
|
|
|
|
Windows is one big platform which runs a lot of different applications at once no matter x86 or x64
This depends on the processor type (32 or 64 bit)
When the application is different from the processor bit, the one simulates the environment and still runs the application (of course when it can - from 64 to 32 is possilble)
So logically must be the way.. methinks
|
|
|
|
|
No, Windows is an operating system and runs in 32 bit or 64 bit mode, depending on the hardware. You cannot run 64 bit code on a 32 bit hardware platform. And you cannot mix 32 and 64 in the same application. You should go to MSDN and study the Microsoft documentation on the subject.
|
|
|
|
|
If you cannot rebuild all of the assemblies to a consistent format, you may be able to force them all to use 32 bit by using CorFlags[^] to enforce 32 bit in the assembly header.
This space for rent
|
|
|
|
|
I need to use large arrays up to 2GB
byte[] b = new byte[2000000000];
It possible just on x64 platform
|
|
|
|
|
Since when?
The indexer is a 32bit int in both x64 and x86 systems, and that means they are subject to the .NET limit of 2GB as the maximum size of any single object.
But...if you are trying to use data that large, it's likely that your algorithm could use some serious looking at - there may be more efficient ways to handle this than just blindly loading huge data into memory. What are you using it for?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Well... I'm receiving the data as byte array, containing the zip file - approx 24MB
Then I have to unpack it into 1,5GB file and pass it to another module as new byte array
...Otherwise I'll have to rebuild the target module I have no source code because it's not mine
|
|
|
|
|
That's some SERIOUS compression ratio going on there! Must be a whole load of redundancy in the source data...
But... If you are passing this to another module, you don't have any choice as to using x86 or x64 - you have to match the "target module": you can't switch between x32 and x64 code in the same process.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
yep.. I've just realized that..
The program is the legacy from the previous team, when the users did not send large amount of data and there was enough memory to unpack their files directly in RAM using the MemoryStream.
Now the situation was changed and the amount of "megabytes" is not considering as "large" anymore
|
|
|
|
|
You've lost me! Indexer is 32 bit means an object size limit of 2GB? Not really, it means that if you ignore the unsigned values you can have up to 2^31 elements per dimension of the array, which is enough for a 2,000,000,000 byte byte array as specified.
Arrays can have over 4 billion elements across dimensions, and the 2GB limit can be lifted on 64 bit platforms with the newfangled gcAllowVeryLargeObjects wotsit.
https://msdn.microsoft.com/en-us/library/hh285054(v=vs.110).aspx
I'd venture that a push you could just about get away with this in 32 or 64 bits with other dubious settings. Or die trying...
Regards,
Rob Philpott.
|
|
|
|
|
I tried that trick on .net 45, but it doesn't work or I did something wrong
Just change the platform has real effect
|
|
|
|
|
Hi,
I have a class A that inherits another class B and calls a method in Class B. That method in turn calls another method which is overridable in Class B. Now, I want the inner method to be created in the calling Class A. But I noticed that the control comes to the first method in Class B and then goes to the inner method in Class B itself. Is it possible to bypass that inner method and call my overrided method instead?
Thanks
|
|
|
|
|
Can you show the minimum amount of code required to demonstrate the situation?
|
|
|
|
|
The least you can do is show the code you are working with, and make some effort. Look up the words 'new and 'override in the context of .NET inheritance, think about them, try using them, then, come back here with specific questions and code.
«There is a spectrum, from "clearly desirable behaviour," to "possibly dodgy behavior that still makes some sense," to "clearly undesirable behavior." We try to make the latter into warnings or, better, errors. But stuff that is in the middle category you don’t want to restrict unless there is a clear way to work around it.» Eric Lippert, May 14, 2008
|
|
|
|
|
That's a confusing sentence, but make sure the methods in the base class are marked as virtual.
Regards,
Rob Philpott.
|
|
|
|
|
Yes - that is exactly what inheritance and method overriding is all about!
public class A : B
{
public void DoIt()
{
Console.WriteLine("A:DoIt");
InB();
}
public override void Inner()
{
base.Inner();
Console.WriteLine("A:Inner");
}
}
public class B
{
public void InB()
{
Console.WriteLine("B:InB");
Inner();
}
public virtual void Inner()
{
Console.WriteLine("B:Innner");
}
}
Then when you create an instance:
A a = new A();
a.DoIt();
You get:
A:DoIt
B:InB
B:Innner
A:Inner
Because B.Inner is marked as virtual it can be overridden in derived classed - as it is in A - and the system will look for the most "appropriate" version to call. Because a is declared as an instance of the A class, it calls the A version of the method.
If you declared a as a B instead but assigned it an A (which is perfectly fine as every A is a "superset" of B):
B b = new A();
b.Inner();
You can't call the DoIt method (because B doesn't contain a definition for DoIt), but you will still get:
B:Innner
A:Inner Becuase the value inside the variable b is still an instance of the A class so the system calls the "latest" version.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Thanks all for your help. I now have an insight on Inheritance.
|
|
|
|