|
hi. friends
small clarification in log4net.
i am new to log4net so any mistake correct me.
i have small program that uses log4net, and i have two appenders like
1.LogFileAppender (writes log to file)
2.ADONetAppender (writes log to DB)
then i have
<root>
<level value="DEBUG" />
<appender-ref ref="LogFileAppender" />
<appender-ref ref="ADONetAppender" />
</root>
when i use this config..my logs written in both
my question are
1. what is that "level value="DEBUG" or INFO " what dose it do and what is the different??
2. i have to write my write debug and info log to my log file and other error,fatal & warning logs to db how can i do that??
any idia of like???
thanks
joe
|
|
|
|
|
hi friends
i found the answer
1. it is to set the level like(debu,Info,Warn,Error,fatal)
2.it is possible by setting
(use any one of this code in said the specific appender)
this will set the top level
<threshold value="DEBUG"/>
this will filter the level
<filter type="log4net.Filter.LevelRangeFilter">
<levelMin value="DEBUG" />
<levelMax value="WARN" />
</filter>
Thanks
|
|
|
|
|
Hi,
I'm writing a generic DAL layer for my development team because we dont want to give access of connection to the developers. I'm stuck in terms of providing option to handle Transaction oriented queries. Could some one throw light?
So, lets say I've 3 queries which have to be executed under one transaction. Since developer dont have access to Connection they can not create transactions.
Shall I take array of queries and parameters from client and execute within the Transaction Block? Is it a right approach.
Note:- I'm not using ORM hence I can not use Command Patterns also.
Thanks
|
|
|
|
|
|
|
The application shouldn't know that multiple queries are required -- it should just call one API method and pass in the data. What happens inside that method might involve a transaction.
PlaceOrder ( Customer , Item )
Begin transaction
Insert order
Insert invoice
Adjust inventory
Commit transaction
|
|
|
|
|
I developed a DLL in C#
When I am trying to call it I get:
System.EntryPointNotFoundException: Unable to find an entry point named:
It means that DLL doens't export any methods visible from DLL. Dumpbin doesn't show any methods either:
dumpbin.exe -exports ActiveXTest.dll
Dump of file ActiveXTest.dll
File Type: DLL
Summary
2000 .reloc
2000 .rsrc
2000 .text
What's wrong????
The DLL looks ok.. according to documentation:
namespace Kosmala.Michal.ActiveXTest
public static void setHooks()
{
....
}
Here is how I call it:
namespace IWFHotkeyStarter
{
class Program
{
[DllImport("D:\\work\\iwf\\_ctrl-tab-modless_dlg_testing\\activex\\VSProjects\\AcriveXSourceCode\\bin\\Debug\\ActiveXTest.dll")]
public extern static void setHooks();
static void Main(string[] args)
{
Program p = new Program();
p.run();
}
private void run(){
Console.WriteLine("run<<");
setHooks();
Console.WriteLine("run>>");
}
}
}
Please help
|
|
|
|
|
Why are you using a DLLImport and an external function declaration? Why not just add a reference in Visual Studio in your IWFHotkeyStarter by right-clicking the References folder and clicking Add Reference, then browsing for the DLL.
Better yet add both projects to the same solution and use a Project Reference.
Forgive me if you're doing this for a specific reason, but I'm guessing it doesn't work because C# DLLs are not machine code. I've only ever seen DLLImport and extern used for native DLLs, whereas .NET DLLs are in IL, not native code.
Then you will have something like:
using Kosmala.Michal.ActiveXTest;
namespace IWFHotkeyStarter
{
class Program
{
static void Main(string[] args)
{
Program p = new Program();
p.run();
}
private void run(){
Console.WriteLine("run<<");
ActiveXTest.setHooks();
Console.WriteLine("run>>");
}
}
}
|
|
|
|
|
you seem confused. A DLL is one of these two:
1.
a bunch of managed code, invisible to DUMPBIN, no need for DllImport; just add reference, use a using statement, and use its public types as if they are part of your EXE itself. the DLL will be copied into your EXE's folder.
2.
a bunch of native code (hence not C#), visible to DUMPBIN; needs DllImport and C# prototypes; add reference is impossible, P/Invoke is required; the DLL gets located through the Windows PATH environment variable.
|
|
|
|
|
Hello, I've created a web performance test that logs me in to an internal site. I want to be able to hide the password in the code so I can check it into VSS. I see that creating CodedUI tests seem to encrypt the passwords (i.e. you see what looks to be a hash string instead).
Is there a way to more easily do that with web performance tests?
Thanks in advance for any assistancee.
------
jboyd
|
|
|
|
|
Hi guys. I am looking for a simple FTP connection. I have an FTP Server running on my local machine. How do I connect to this FTP server using code? All the samples I find refer to a WEB FTP connection. Can somebody direct me to a simple ftp connection that connects to either a local FTP server or connection to an FTP server on a network?
Thanks guys.
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
I expect FtpWebRequest to work similar to HttpWebRequest, so use the IP address and go ahead. Whether your server is local or on the Internet seems irrelevant to me.
|
|
|
|
|
Hi,
You can use below API's...
Private Declare Function InternetCloseHandle Lib "wininet.dll" (ByVal hInet As Long) As Integer
Private Declare Function InternetConnect Lib "wininet.dll" Alias "InternetConnectA" (ByVal hInternetSession As Long, ByVal sServerName As String, ByVal nServerPort As Integer, ByVal sUserName As String, ByVal sPassword As String, ByVal lService As Long, ByVal lFlags As Long, ByVal lContext As Long) As Long
Private Declare Function InternetOpen Lib "wininet.dll" Alias "InternetOpenA" (ByVal sAgent As String, ByVal lAccessType As Long, ByVal sProxyName As String, ByVal sProxyBypass As String, ByVal lFlags As Long) As Long
Private Declare Function FtpSetCurrentDirectory Lib "wininet.dll" Alias "FtpSetCurrentDirectoryA" (ByVal hFtpSession As Long, ByVal lpszDirectory As String) As Boolean
Private Declare Function FtpGetCurrentDirectory Lib "wininet.dll" Alias "FtpGetCurrentDirectoryA" (ByVal hFtpSession As Long, ByVal lpszCurrentDirectory As String, lpdwCurrentDirectory As Long) As Long
Private Declare Function FtpCreateDirectory Lib "wininet.dll" Alias "FtpCreateDirectoryA" (ByVal hFtpSession As Long, ByVal lpszDirectory As String) As Boolean
Private Declare Function FtpRemoveDirectory Lib "wininet.dll" Alias "FtpRemoveDirectoryA" (ByVal hFtpSession As Long, ByVal lpszDirectory As String) As Boolean
Private Declare Function FtpDeleteFile Lib "wininet.dll" Alias "FtpDeleteFileA" (ByVal hFtpSession As Long, ByVal lpszFileName As String) As Boolean
Private Declare Function FtpRenameFile Lib "wininet.dll" Alias "FtpRenameFileA" (ByVal hFtpSession As Long, ByVal lpszExisting As String, ByVal lpszNew As String) As Boolean
Private Declare Function FtpGetFile Lib "wininet.dll" Alias "FtpGetFileA" (ByVal hConnect As Long, ByVal lpszRemoteFile As String, ByVal lpszNewFile As String, ByVal fFailIfExists As Long, ByVal dwFlagsAndAttributes As Long, ByVal dwFlags As Long, ByRef dwContext As Long) As Boolean
Private Declare Function FtpPutFile Lib "wininet.dll" Alias "FtpPutFileA" (ByVal hConnect As Long, ByVal lpszLocalFile As String, ByVal lpszNewRemoteFile As String, ByVal dwFlags As Long, ByVal dwContext As Long) As Boolean
Regards,
SunilG.
|
|
|
|
|
Thanks for that, however:
1. I'm not the one asking for an FTP solution; you replied to the wrong message.
2. This is the C# forum, no need for VB code.
3. And why would we use P/Invoke when .NET itself has what is required.
|
|
|
|
|
Apart from that, what have the Romans ever done for us?
|
|
|
|
|
Pete O'Hanlon wrote: what have the Romans ever done for us?
Lots of good things came from the Romans.
They gave us nice roads, connecting major cities, sometimes in remarkably straight lines; admittedly, they haven't been upgraded soon enough (the roads I mean), so now we sometimes have a bit of a jam.
And then they gave you the Hadrian Wall, to protect you against neighboring savages. How can you forget all that?
|
|
|
|
|
Not a Monty Python fan then I take it. Clickety[^]
|
|
|
|
|
Under other circumstances, yes, I am, very much so. I do appreciate the classics.
Questions in programming forums are always taken seriously though.
Well, maybe not really always...
|
|
|
|
|
Forgot to mention, I also appreciate Cleese's more serious stuff: his business training movies, seminars, etc. Enjoyed a couple of interviews he gave. Quite a guy.
|
|
|
|
|
My dear friend,
I havent told you to copy and paste all the APIs in C#.
You can you these APIs in C# only the syntax is different.
Regards,
|
|
|
|
|
I have used this sample Multi-Y Demo from the ZG Wiki site to build a graph that has 4 Y Axis points and the X axis is time based.
The first time through all the y axis stuff works as expected. The 4 items are of dissimilar values and the ranges in the y legends range correctly.
For example
y1 legend has a range of 15 - 35
y2 legend has a range of 85 - 90
y3 legend has a range of 6 - 16
y4 legend has a range of 4 - 24
The from then on only the first 2 y axis legends range correctly but 3 and 4 seem to use the existing y1 and y2 values.
For example
y1 legend has a range of 15 - 35
y2 legend has a range of 85 - 90
y3 legend has a range of 15 - 35
y4 legend has a range of 85 - 90
So I have been unsucessful in trying to clear all y legends.
I have tried...
zg1.GraphPane.CurveList.Clear();
Again it works the first time but not the second.
Has anyone ran into this? Is there a way to dispose and then re create the control programatically so that it would run like it was the first time?
Any Help Would Be Appreciated
rafone
Statistics are like bikini's...
What they reveal is astonishing ...
But what they hide is vital ...
|
|
|
|
|
I have some image url, such as http://images.csdn.net/20101130/2.jpg[^]
I want to download it to local disk using the WebClient, but error.
WebClient webClient = new WebClient();
Uri uri = new Uri("http://" + address);
webClient.BaseAddress = "http://" + uri.Authority;
webClient.DownloadFile(uri, fileName);
The local *.jpg display html label. <!--
This file is used for request transmitted from lighttpd or nginx.
-->
|
|
|
|
|
your code worked for me.
suggestions:
1. enter your error message in the Google search box.
2. if that does not help, tell us the exact error, all of it, and point us to the line it mentions, if any.
|
|
|
|
|
Hi,
I want to develop a simple POS machine software for a supermarket.. It seems that everything is fine but I just want to know how can I open the cash drawer from my C# application regardless of the machine brand and model?
Thanks,
Jassim Rahma
|
|
|
|
|
Again I must tell you to stop flooding forum with question only from your side.
kindly follow my suggestion what I gave you on ASP.NET forum, Please.
|
|
|
|