|
You need to speficify, code, test and deploy a complete client server authorisation suite in less than a day?
Why did you not think about this last week?
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
hello
[sorry about long trace thought it may help]
I ran into this remoting permission problem after signing my dll's, any idea why signing has anything to do with this please? (I confirmed this has to do with signing because I restore my last good backup, then sign my util dll's and rerun test cases, which gives me this)
<br />
2009-05-15 09:07:01,578 [1] ERROR RemotingInterfaceInteractiveClient - xxxxx.Util.ApplicationException Exception context: xxxxx.Util.ApplicationExceptionContext, Subject: RemotingInterfaceInteractiveClient - RunCommandLoop error, Description: System.Runtime.Serialization.SerializationException: Because of security restrictions, the type xxxxx.Util.Command.AdminCommands.ApplicationContextRequestCmd cannot be accessed. ---> System.Security.SecurityException: Request failed.<br />
at System.Runtime.Serialization.FormatterServices.nativeGetSafeUninitializedObject(RuntimeType type)<br />
at System.Runtime.Serialization.FormatterServices.GetSafeUninitializedObject(Type type)<br />
The action that failed was:<br />
Demand<br />
The type of the first permission that failed was:<br />
System.Security.PermissionSet<br />
The demand was for:<br />
<PermissionSet class="System.Security.PermissionSet"<br />
version="1"<br />
Unrestricted="true"/><br />
<br />
The only permitted permissions were:<br />
<PermissionSet class="System.Security.PermissionSet"<br />
version="1"><br />
<IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"<br />
version="1"<br />
Flags="SerializationFormatter"/><br />
</PermissionSet><br />
<br />
The method that caused the failure was:<br />
System.Runtime.Remoting.Channels.ServerProcessing ProcessMessage(System.Runtime.Remoting.Channels.IServerChannelSinkStack, System.Runtime.Remoting.Messaging.IMessage, System.Runtime.Remoting.Channels.ITransportHeaders, System.IO.Stream, System.Runtime.Remoting.Messaging.IMessage ByRef, System.Runtime.Remoting.Channels.ITransportHeaders ByRef, System.IO.Stream ByRef)<br />
--- End of inner exception stack trace ---<br />
<br />
Server stack trace: <br />
at System.Runtime.Serialization.FormatterServices.GetSafeUninitializedObject(Type type)<br />
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ParseObject(ParseRecord pr)<br />
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Parse(ParseRecord pr)<br />
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record)<br />
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryHeaderEnum binaryHeaderEnum)<br />
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()<br />
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)<br />
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)<br />
at System.Runtime.Remoting.Channels.CoreChannel.DeserializeBinaryRequestMessage(String objectUri, Stream inputStream, Boolean bStrictBinding, TypeFilterLevel securityLevel)<br />
at System.Runtime.Remoting.Channels.BinaryServerFormatterSink.ProcessMessage(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders, Stream& responseStream)<br />
<br />
Exception rethrown at [0]: <br />
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)<br />
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)<br />
at xxxxx.Util.Command.CommandRunner.set_Commands(List`1 value)<br />
at RemotingInterfaceInteractiveClient.Program.ProcessCommandFile(RemotingClientSetup& oSetup) in C:\dev\xxxxx\NET3.0\RemotingInterfaceInteractiveClient\Program.cs:line 163, StackTrace: at xxxxx.Util.ApplicationException.Throw(String strSubject, String strSummary, String strDescription, Exception oInnerException) in C:\dev\xxxxx\NET3.0\Util\ApplicationException.cs:line 176<br />
... System.Runtime.Serialization.FormatterServices.nativeGetSafeUninitializedObject(RuntimeType type)<br />
at System.Runtime.Serialization.FormatterServices.GetSafeUninitializedObject(Type type)<br />
Many thanks!
dev
|
|
|
|
|
i'm thinking perhaps it has to do with StrongNameIdentityPermission - but seems like un-signed code is granted to make call to deserialize sent data, while signed code failed. That's very counterintuitive.
But really I'm suspecting something like this in "System.Runtime.Remoting.Channels.ServerProcessing.ProcessMessage"
<br />
StrongNamePublicKeyBlob publickeyblob = new StrongNamePublicKeyBlob (publickey); <br />
System.Version ver = new Version(version); <br />
StrongNameIdentityPermission sip = new StrongNameIdentityPermission(publickeyblob,strongname,ver);<br />
sip.Demand();<br />
But then looking at error where failure occured: System.Security.Permissions.SecurityPermission
(With Permission Flag = SerializationFormatter)
How can I check if my user account (which is local machine Administrator !!) has SerializationFormatter permission? Or most importantly, how can I grant such permission?
In fact I checked by (run under same user account), and the user *indeed* has the permission (i.e. no SecurityException thrown in below code):
<br />
System.Security.Permissions.SecurityPermission oSecPerm = new System.Security.Permissions.SecurityPermission( System.Security.Permissions.SecurityPermissionFlag.SerializationFormatter);<br />
try<br />
{<br />
oSecPerm.Demand();<br />
<br />
Console.WriteLine("Operation permitted!1");<br />
}<br />
catch (System.Security.SecurityException ex)<br />
{<br />
Console.WriteLine("Operation not permitted!!");<br />
}<br />
I also used caspol -resolvegroup to check which code group it belongs (RemotingInterfaceInteractiveClient.exe and Util.dll - both shows it belongs to groups with Full trust all all policy levels)
I further confirmed this by: caspol -security off
Then watch test cases failed even after caspol is OFF!?
Help needed, really confused.
http://msdn.microsoft.com/en-us/library/system.security.permissions.securitypermission.aspx
http://msdn.microsoft.com/en-us/library/system.security.permissions.securitypermissionflag.aspx
dev
modified on Friday, May 15, 2009 2:20 AM
|
|
|
|
|
How can i use timer control and serialport control to dynamic refresh my number of 3 different show control......
i want to get the data form serialport....
namespace ShowNumber
{
public partial class Form1 : Form
{
//public int num = 0;
private bool serialflag = false;
public Form1()
{
InitializeComponent();
//this.label1.Text = num.ToString();
//serialPort1.Open();
}
private void timer1_Tick(object sender, EventArgs e)
{
if (!serialflag)
{
serialflag = true;
serialPort1.ReceivedBytesThreshold = 1;
try
{
this.serialPort1.Open();/// always error here
}
catch (System.Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void serialPort1_DataReceived(object sender, System.IO.Ports.SerialDataReceivedEventArgs e)
{
byte []bt = new byte[1];
serialPort1.Read(bt,0,bt.Length);
string str = bt.ToString();
switch (str)
{
case "0":
{
MessageBox.Show("bt == 0");
label1.Text += str;
}
break;
case "1":
{
MessageBox.Show("bt == 1");
label2.Text += str;
}
break;
case "2":
{
MessageBox.Show("bt == 2");
label3.Text += str;
}
break;
case "3":
{
MessageBox.Show("bt == 3");
label4.Text += str;
}
break;
case "4":
{
MessageBox.Show("bt == 4");
label5.Text += str;
}
break;
default:
break;
}
serialPort1.Close();
serialflag = false;
}
modified on Thursday, May 14, 2009 9:48 PM
|
|
|
|
|
Hi,
your question is not clear at all.
there are at least 3 different timer classes, for a WinForm app I suggest you look at System.Windows.Forms.Timer since that one ticks on the GUI thread.
for SerialPort receive, either poll and read available data yourself on the GUI thread, or use the DataReceived event which runs on a different thread, so you can update the GUI only by using the Control.InvokeRequired/Control.Invoke pattern.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
thanks
i copied my code here
|
|
|
|
|
Does any one know if any one made a Library to create BBS doors in C# or VC#
I'm looking for some thing that will work with VC# 2008 express.
Thanks
|
|
|
|
|
I too, would like to have this.
|
|
|
|
|
|
'System.Configuration.ConfigurationException.ConfigurationException(string)' is obsolete: 'This class is obsolete, to create a new exception create a System.Configuration!System.Configuration.ConfigurationErrorsException'
What exactly does MS want me to do here? I can't create a System.Configuration.ConfigurationErrorsException to update my legacy throw statements.
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
To [No name supplied] (person whose reply was eaten by a bug[^]):
I did try throw System.Configuration!System.Configuration.ConfigurationErrorsException("blah"); but it gets a compiler error of "; expected" on the exclamation point.
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
I wrote a application that will unlock users when they get locked out. I need my application to authenticate and run as a admin user so it can unlock the locked out users when a normal user runs it. I need to have the the admin credentials stored inside my application so it authenticates first then unlocks the locked out users if you need to see my code i will be happy to post.
I dont want to add a text box for user or pass and give the person who will be using this a admin account.... not cool
and this admin account that will be stored inside my app will be monitored closely.
Thank you for your time
Summey
|
|
|
|
|
Good people,
So, I built and installed my app. However, I can't find it in program files. Then I find out that "Click Once" installs it in the (general?) application cache.
My question is: how do I navigate to it in Windows Explorer. I want to check out some of the installed data files to make sure it's working. I have tried locating it in many directories including "Program Files", "Windows", etc...
Any help you can provide would be helpful.
Thanks,
Blitz
|
|
|
|
|
Use Windows explorer to search for the executable ie "myapp.exe". You should find it, then right click and choose "Open Location".
|
|
|
|
|
HELLO! I am student, created a program to capture video from camcorders machines, I would like to see the images of machines camcorders the Internet.
You can help me? Initially I'm using webcam.
This program is for completion of course.
thanks!
|
|
|
|
|
I'm afraid we can't help with such a general question. But to be able to see the images of another machines camera over the internet, they would need to be broadcasting it. To broadcast the images, you would probably also need some kind of server to broadcast to.
If it is for a project, the server could just be another machine on the network.
My current favourite word is: Delicious!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
I am trying to call a stored procedure from C#. The stored procedure, called create_journal, compiles succesfully on SQL Server and also runs sucessfully when executed in query analyzeer. It takes a datetime input parameter. When I call it from C#, I get an SqlException which says Error 170. Line 1 Incorrect syntax near create_journal_entry
The stored Procedure begins as follows
ALTER PROCEDURE create_journal_entry
@eom_date DATETIME --End of month date
AS
DECLARE
@next_jrnl_num VARCHAR(20)
The c# code is
private void createJEs()
{
DateTime cutOffDate;
cutOffDate=this.dtpCutOffDate.Value;
SqlConnection conn =new SqlConnection(DBConnection.connectionString());
conn.Open();
SqlCommand comm=new SqlCommand("create_journal_entry",conn);
comm.Parameters.Add("@eom_date",SqlDbtype.DateTime);
comm.parameters["@eom_date"].value=this.dtpCutOffDate.Value;
try
{
comm.ExecuteNonQuery();
moveFiles();
MessageBox.Show("Data has been successfully sent to the
GL.", "Success",MessageBoxButtons.YesNo,MessageBoxIcon.Information);
}
catch(SqlException ex)
{
MessageBox.Show("Error "+ex.Number + " "+ ex.Message,"SqlServer
error",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
}
catch(Exception ex)
{
MessageBox.Show(ex.Message,"System Error",
MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
}
finally
{
if (conn!=null)
{
conn.Close();
}
}
}
NB this.dtpCutOffDate is a DateTime picker control.
Please help as I am going nuts over this.
Thanks
|
|
|
|
|
You have to set your command object to stored proc type. i.e.
After this line
SqlCommand comm=new SqlCommand("create_journal_entry",conn);
Type this
comm.CommandType = CommandType.StoredProcedure
The default is text so it is reading 'create_journal_entry' as your query.
|
|
|
|
|
Thanks a batch! It worked right away......just wondering why the heck I could not see that. Feels like Friday.
|
|
|
|
|
I'd like to monitor a text file to see when an outside program changes the contents of it. Is there a simple way to do this??? Actually, the easiest way to do this for me might be to see when the it saves or closes.
|
|
|
|
|
|
You could check out FileSystemWatcher.. I can't remember if it'll tell you if the file's been opened or closed but it does let you know when a file has been changed, created, deleted etc... You can find it inside your ToolBox in Visual Studio
jay
|
|
|
|
|
Good deal. thank you both. I'm trying to make a PDF buttonclick event register in my code, but apparently this is very hard to do... So i decided to make the buttonclick in the PDF open and change a document. Then my C# app will hopefully see it and respond...worth a try any way. Thanks again.
jpc
|
|
|
|
|
According to this thread[^] it is possible if you're using Acrobat (not reader) with a little Java.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
I have a simple scene in Direct3D in c#, but i am having trouble getting it to draw objects in the right order:
Image 1
Image 2 (Wrongness)
device.Clear(ClearFlags.Target, Color.Black, 1.0f, 0);<br />
device.BeginScene();<br />
device.VertexFormat = CustomVertex.PositionTextured.Format;<br />
<br />
LoadTexturesAndMaterials("TexFloor.png");<br />
device.SetTexture(0, texture);<br />
device.DrawUserPrimitives(PrimitiveType.TriangleList, 8, Floor);<br />
<br />
LoadTexturesAndMaterials("TexPillar.png");<br />
device.SetTexture(0, texture);<br />
device.DrawUserPrimitives(PrimitiveType.TriangleList, 16, MakePillar(new Vector3(fb, 0, 0), 4, 0.2f));<br />
device.DrawUserPrimitives(PrimitiveType.TriangleList, 16, MakePillar(new Vector3(-fb, 0, 0), 4, 0.2f));<br />
device.DrawUserPrimitives(PrimitiveType.TriangleList, 16, MakePillar(new Vector3(0, 0, -fb), 4, 0.2f));<br />
<br />
LoadTexturesAndMaterials("TexCrystal.png");<br />
device.SetTexture(0, texture);<br />
device.DrawUserPrimitives(PrimitiveType.TriangleList, 32, Crystal);<br />
<br />
device.EndScene();<br />
device.Present();<br />
Graphics g = this.CreateGraphics();<br />
g.DrawString("HUD Test", this.Font, Brushes.Red, new PointF(20, 20));<br />
this.Invalidate();<br />
|
|
|
|
|