|
I suggest you have a look at string.CompareOrdinal()
|
|
|
|
|
Please, I need some idea on how to secure a password string against keylogger spywares installed on a client host.
PLEASE, password input is via the KEYBOARD only.
thanks, ur suggestions will be appreciated.
|
|
|
|
|
You could register a new keyboard hook which doesn't call CallNextHookEx , that's a bit nasty though and it can break hotkeys and other programs (and keyloggers, but that's the point)
If you do this and a keylogger (re-)registers its hook, the keylogger will still work.
Also, it will only work against simple usermode keyloggers.
|
|
|
|
|
I have agridview i fill it from datatable but i want to add new emptyrow af first before filling
|
|
|
|
|
gridview.Rows.add("",""....);
OR
gridview.Rows.add(5);
EASY COME EASY GO
|
|
|
|
|
i tried this
gridview1.Rows.Add();
gridview1.DataSource = ds;
this exception
No row can be added to a DataGridView control that does not have columns. Columns must be added first.
|
|
|
|
|
this exception
No row can be added to a DataGridView control that does not have columns. Columns must be added first.
so what do you think the problem???
how many col in your database?
if 2
then
for example:
gridview1.columns.add("id","id");
gridview1.columns.add("name","name");
then try it
if it did not work try to add them row by row
EASY COME EASY GO
|
|
|
|
|
Thank u sanforjackass
thats help me alot.
|
|
|
|
|
EASY COME EASY GO
|
|
|
|
|
Hi,
I implemented this simple scenario containing 3 assemblies:
- TL (Transport Layer) assembly that contains only one class 'Class1':
public class Class1 : MarshalByRefObject { public int MyProperty { get; set; } }
and one interface:
public interface Interface1 { Class1 Get(int i); }
- BLL (Business Logic Layer) application that will act as a server in my remoting scenario. This assembly has reference to TL assembly and contains 2 files:
BLL Manager:
<br />
class BLLManager : Interface1 { public Class1 Get(int i) { return new Class1() { MyProperty = i - 1 }; } } <br />
And an xml file:
<?xml version="1.0" encoding="utf-8" ?><configuration> <system.runtime.remoting> <application> <channels> <channel ref = "tcp" port = "5001" /> </channels> <service> <wellknown mode = "SingleCall" type = "TL, Interface1" objectUri = "Uri1" /> </service> </application> </system.runtime.remoting></configuration>
The BLL assembly is a Windows Service. In the OnStart method I included the following code:
<br />
protected override void OnStart(string[] args) { RemotingConfiguration.Configure(@"C:\somefolder\BLL\bin\Debug\Config.xml", false); }
I installed this service and started it.
Third assembly is a simple Web application that acts as a .NET Remoting client here; it contains reference to TL as well. This assembly contains config file 'Web.config':
<?xml version="1.0"?>...
<system.runtime.remoting> <application> <client> <wellknown type = "TL.Interface1, Uri1" url="tcp://lsrv01:5001/BLL" /> < </client> <channels> <channel ref="tcp" port="0"/> </channels> </application> </system.runtime.remoting></configuration>
It also contains Default.aspx, which has the following C# code:
<br />
RemotingConfiguration.Configure(@"C:\/*some path*/\Web.config", false); <br />
Interface1 obj = (Interface1)Activator.GetObject(typeof(Interface1), "tcp://lsrv01:5001/BLL"); <br />
var i = obj.Get(5);
However I`m getting RemoteException in the last line. It say: "Server encountered an internal error. For more information, turn off customErrors in the server's .config file." In my web application I modified the web.config file accordingly:
<authentication mode="Windows"/> <customErrors mode="Off" defaultRedirect="GenericErrorPage.htm"> <error statusCode="403" redirect="NoAccess.htm" /> <error statusCode="404" redirect="FileNotFound.htm" /> </customErrors>
But it didn't make any difference. Could you please help me to try to figure out what is wrong in my scenario?
Thank you very much for any useful help.
modified on Friday, April 16, 2010 11:58 AM
|
|
|
|
|
One of the reasons that .NET remoting is no longer used is because even the simplest remoting problem was complex to implement. It took me almost a year to become a remoting expert. Much of the remoting elements within the framework are also Obsolete.
I would suggest you deploy your service as a wcf service, then the rest is a very simple process. In your web application all you need to do is Add Web Service and you are running.
You can host the service in iis or bind it to whatever protocol you want. An advantage of WCF over Remoting is that you control the entire service config with an editor and attributes. You can build new wcf services and bind to them in a day without the headaches you are experiencing. As it is, once I started using WCF I completely let go of all memory of remoting. If you find you need to change protocols or bindings, it is a simple matter of changing attributes without changing any code.
Use WCF and forget about remoting ever existing.
|
|
|
|
|
hey,
ive been thinking for days about how i could go about the following.
1. User selects a sound from their computer.
2. It is loaded into the application.
3. The user presses the execute button.
4. The application adds a sound to the loaded one at recurring intervals of 10 seconds.
5. It is then saved into a user-defined directory with a user-defined name.
I just cannot think of a way to achieve this.
Any help here would be hot
|
|
|
|
|
You might want to have a look at this project then. C# Synth Toolkit - Part I[^] I think it accomplishes what your looking for and then some.
Fear not my insanity, fear the mind it protects.
|
|
|
|
|
TcpClient.cs
namespace TCP_Communication
{
public class TcpClient
{
public delegate void DataArrivalDelegate(char[] data);
public DataArrivalDelegate OnDataArrival = null;
}
}
Program.cs
using System;
using System.Collections.Generic;
using System.Text;
namespace TCP_Communication
{
public class Program
{
static void Main(string[] args)
{
TcpClient Client = new TcpClient();
Client.OnDataArrival = new TcpClient.DataArrivalDelegate(OnDataAvailable);
}
public void DataArrived(char[] newdata)
{
}
}
}
Error:
'OnDataAvailable': cannot reference a type through an expression; try 'TCP_Communication.TcpClient.OnDataAvailable' instead
I'm new to C#.
I read the article in MSDN about C# delegates, but still I can't find what I'm missing.
Can you please help me fix this problem?
Thanks.
|
|
|
|
|
Your handler has to be declared as "static", just like Main().
|
|
|
|
|
Just curiosity, can tell me why does it has to be static?
|
|
|
|
|
Because you're not creating an instance of the Program class, but rather just using it as a container for the Main() method.
Basically, a static method operates on an entire class/type, while an instance method (non-static) operates on a single object of that type.
|
|
|
|
|
To add to Ian's answer, an instance method can access both static and other instance methods, but a static method can only access other static methods. Since Main is static, it cannot access instance method of the Program class.
Dybs
The shout of progress is not "Eureka!" it's "Strange... that's not what i expected". - peterchen
|
|
|
|
|
Also this :
Client.OnDataArrival = new TcpClient.DataArrivalDelegate(OnDataAvailable);
Probably needs to be changed to this:
Client.OnDataArrival = new TcpClient.DataArrivalDelegate(DataArrived);
or better:
Client.OnDataArrival = DataArrived;
Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.
|
|
|
|
|
I figure he just copy-pasted it wrong, or he'd be getting an entirely different error
|
|
|
|
|
Hey Guys,
I have a string consisting of zeros and ones like 10101010
I want to read each letter then convert it to code and use it ... I've checked the function Split() but it requires a character, and as u see mine doesn't have any.
Regards,
K
|
|
|
|
|
Just use - ToCharArray()
string strTest = "1100110101";
char[] cList = strTest.ToCharArray();
modified on Friday, April 16, 2010 7:33 AM
|
|
|
|
|
This is okay unless you don't want to allocate more memory in the process. Using string.Substring() would be a viable alternative.
(I still marked your response as a "good answer". )
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Yes, thanks for pointing that out..
Regards,
Neh
|
|
|
|
|
Try using the Substring method of a string .
|
|
|
|