|
You want to know how to capture screen in C#.
Or you want to edit the screen capturing with camtasia?
|
|
|
|
|
Hi,
I have tried out the camtasia software, i dont think it supports .NET and aswell as the file is bulky.
Threrefore i like to know, is there anyother SW to use with .NET.
mainly i want to know about the motion capturing of the mouse moments,and the curser.
I found a free trial version of terbodemo SW 7.5.it captures the screen as screenshots and it plays as a movie clip.
please help me to find a .NET cording to meet my challenges.
Thank you
Khema
Khema
|
|
|
|
|
Hi,
I have already used the Camtasia SW, but the file that create is very bulky, therefore I like to find some coding for .NET compatible SW.
I have found another SW called TerboDemo(7.5 trial version), which captures the screen as an array of screenshots, which also take big capacity. It saves in .tdp format.
Please help me to find a .NET cording.
Thanks and Regards
|
|
|
|
|
i am making a window application in dotnet c#.
There is site, whose information i need to keep in database on local client machine.
If someone visits that site, value '1' must be stored in 'sitehit' column of my database else it must contain '0'.
i have field in my database : 'sitehit'.
how is this possible?
Thanking you in adv.
regards nekshan.
|
|
|
|
|
Hi
im devloping a client server program using C#.
What it basically does is the Server can connect 3,4 clients and they can send messags.
To do this i didnt use threads.
My problem is when client send a message to server it is not receved to the server.
Then it indicate a error "Cross thread operation not valid."
This is the solution i found form this site.
---------------------------------------------------------
Private Strt As System.Threading.Thread ;
Strt = New System.Threading.Thread(AddressOf MyThread1)
Strt.Start();
Sub MyThread1
' Working code
' Working code
' Working code
' Working code
' Working code
' Working code
AccessControl()
End Sub
Private Sub AccessControl()
If Me.InvokeRequired Then
Me.Invoke(New MethodInvoker(AddressOf AccessControl))
Else
' Code wasn't working in the threading sub
' Code wasn't working in the threading sub
' Code wasn't working in the threading sub
' Code wasn't working in the threading sub
' Code wasn't working in the threading sub
Button2.Visible = True
Button3.Visible = True
Opacity = 1
ShowInTaskbar = True
End If
End Sub
---------------------------------------------------------
but the problem is hence i do not use threads do i need to create threads to solve this problem?
Im developing the program using C#, so do i need to implement it in a same way of this code?
Thank you so much..
sweenySL
|
|
|
|
|
If you are not using Threads then are you using Asyncronous sockets? It would help a lot if you post your code.
|
|
|
|
|
Try
form1.CheckForIllegalCrossThreadCalls=false;
|
|
|
|
|
Hi,
you create threads when executing asynchronous stuff, e.g. with the timers (except for
Windows.Forms.Timer).
setting CheckForIllegalCrossThreadCalls false only disables the checking, it does
not avoid the problem that may result (UI freeze) immediately or after a while...
If InvokeRequired is true, you really need the Invoke (as you did), and then
the code you invoke should execute; check it with debugger or with logging !
PS: is this a C# question ?
|
|
|
|
|
Hi,
I am using dot net editor 2005.
I have written web site(c#.net,asp.net) which is using excel object in appliation.
Application,_Workbook.
I am feeding all data in excel application sheet.
I am saving file as
excelWorkBook.SaveAs(wwilFilePath,Type.Missing, Type.Missing, Type.Missing, false, false,
XlSaveAsAccessMode.xlNoChange, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
It is saving file in OS Xp.
But in windows server 2003 it will be giving following error:
The file could not be accessed. Try one of the following:• Make sure the specified folder exists.
• Make sure the folder that contains the file is not read-only.
• Make sure the file name does not contain any of the following characters: < > ? [ ] : | or *
• Make sure the file/path name doesn't contain more than 218 characters.
I have tried many combination on server end but probelm stil persist.
Also excel application executes under Network service account,I tried to give full access to this account in all distribution groups(all possible groups),excel application but problem still persist
Can any one help sugest any solution??
Manish
|
|
|
|
|
Manish,
It is considered bad practice to use Excel directly from an IIS web application.
If I remember correctly, no matter where you save to, Excel tries to access folders specific for the user it runs under, such as 'My Documents'. For these type of accounts like network service, ASPNET, etc these folders do not exist and that gives you these type of problems.
The work-around is a queued approach, where you queue requests for doing something with Excel. Then, you run an NT Service under a 'real' user account that picks up these requests and processes it. However, I was forced once to do something like that with Word and it's difficult to implement and it always remains error prone. Microsoft officially recommends against using Office applications in background services and for good reason.
Instead of trying to work around it, I suggest you look into buying one of those third party components that work natively on Excel files without requiring Excel on the server. Those are very stable and much faster than accessing Excel through its own object library. I've used components from SoftArtisans with excellent results.
See: http://www.softartisans.com/[^]
Hope this helps,
Roel
|
|
|
|
|
hi all
i have Datatable contain two colmnun "code" is type int And "Name" is nvarchar
I want search with context is
string arg = "code like '%%'";
dtdistric.Select(arg);
but it error
{"Cannot perform 'Like' operation on System.Int64 and System.String."}
|
|
|
|
|
Try and use LIKE for strings, but for integers use simple assignment '='
e.g,
string arg = "code = 1";
dtdistric.Select(arg);
Mubashir
Every job is a self portrait of the person who did it.
|
|
|
|
|
Hi
Actually, it will work if you give single quotes for int data type. Try converting it to nvarchar(4) for integers.
Hope this will work
Harini
|
|
|
|
|
Hi, everyone,
I'm writing a program to discover wireless network
using Windows Native Wifi API & VB.net.
I have to declare the windows API in my VB.net program.
The original windows declaration is as below.
The problem is in "struct _WLAN_AVAILABLE_NETWORK_LIST",
it declared "WLAN_AVAILABLE_NETWORK Network[1];".
I think which means a Network[] array of struct WLAN_AVAILABLE_NETWORK.
But how about the size of the Network[] array?
Is it "1" or more? what does "1" mean?
If I give it the size of 1, then I can get the first network back,
but if I give it more than 1, for example, 10,
then I got an error of "AccessViolationException".
The full message is "Service cannot be started. System.AccessViolationException:
Attempted to read or write protected memory.
This is often an indication that other memory is corrupt."
Actually, the size of the Network[] array is decided by
dwNumberOfItems at run time, which means the size of the
Network[] array is varied-length not fixed, and in most situations
, the size should be more than 1.
I've searched the solution on the internet, and found some similar situations.
They said we should use IntPtr to get the address of the structure array and
then use Marshal class(Marshal.copy(), Marshal.PtrToStructure()....) to get the array,
instead of declared it as a structure array, but they didn't post a sample Marshalling code.
I've tried to code, but still got "AccessViolationException" at Marshalling.
Anyone knows how to solve the problem?
Could you write a sample code for me in VB.net or C# without unsafe code?
Thanks so much. I appreciate your help.
Windows Native Wifi declarations:
'-----function-----
DWORD WINAPI WlanGetAvailableNetworkList(
HANDLE hClientHandle,
const GUID* pInterfaceGuid,
DWORD dwFlags,
PVOID pReserved,
PWLAN_AVAILABLE_NETWORK_LIST* ppAvailableNetworkList
);
'-----structure-----
typedef struct _WLAN_AVAILABLE_NETWORK_LIST {
DWORD dwNumberOfItems; '===>the actual size of array
DWORD dwIndex;
WLAN_AVAILABLE_NETWORK Network[1]; '===>how to declare the array? should I give it fixed size of 1 or change it to an IntPtr
} WLAN_AVAILABLE_NETWORK_LIST, *PWLAN_AVAILABLE_NETWORK_LIST;
typedef struct _WLAN_AVAILABLE_NETWORK {
WCHAR strProfileName[256];
DOT11_SSID dot11Ssid;
DOT11_BSS_TYPE dot11BssType;
ULONG uNumberOfBssids;
BOOL bNetworkConnectable;
WLAN_REASON_CODE wlanNotConnectableReason;
ULONG uNumberOfPhyTypes;
DOT11_PHY_TYPE dot11PhyTypes[8];
BOOL bMorePhyTypes;
WLAN_SIGNAL_QUALITY wlanSignalQuality;
BOOL bSecurityEnabled;
DOT11_AUTH_ALGORITHM dot11DefaultAuthAlgorithm;
DOT11_CIPHER_ALGORITHM dot11DefaultCipherAlgorithm;
DWORD dwFlags;
DWORD dwReserved;
} WLAN_AVAILABLE_NETWORK, *PWLAN_AVAILABLE_NETWORK;
typedef struct _DOT11_SSID {
ULONG uSSIDLength;
UCHAR ucSSID[32];
} DOT11_SSID, *PDOT11_SSID;
'-----Enumeration-----
typedef enum _DOT11_BSS_TYPE
{
dot11_BSS_type_infrastructure,
dot11_BSS_type_independent,
dot11_BSS_type_any
}DOT11_BSS_TYPE, *PDOT11_BSS_TYPE;
typedef DWORD WLAN_REASON_CODE, *PWLAN_REASON_CODE;
typedef enum _DOT11_PHY_TYPE
{
dot11_phy_type_unknown,
dot11_phy_type_any,
dot11_phy_type_fhss,
dot11_phy_type_dsss,
dot11_phy_type_irbaseband,
dot11_phy_type_ofdm,
dot11_phy_type_hrdsss,
dot11_phy_type_erp,
dot11_phy_type_IHV_start,
dot11_phy_type_IHV_end
}DOT11_PHY_TYPE, *PDOT11_PHY_TYPE;
typedef enum _DOT11_AUTH_ALGORITHM
{
DOT11_AUTH_ALGO_80211_OPEN,
DOT11_AUTH_ALGO_80211_SHARED_KEY,
DOT11_AUTH_ALGO_WPA,
DOT11_AUTH_ALGO_WPA_PSK,
DOT11_AUTH_ALGO_WPA_NONE,
DOT11_AUTH_ALGO_RSNA,
DOT11_AUTH_ALGO_RSNA_PSK,
DOT11_AUTH_ALGO_IHV_START,
DOT11_AUTH_ALGO_IHV_END
}DOT11_AUTH_ALGORITHM, *PDOT11_AUTH_ALGORITHM;
typedef enum _DOT11_CIPHER_ALGORITHM
{
DOT11_CIPHER_ALGO_NONE,
DOT11_CIPHER_ALGO_WEP40,
DOT11_CIPHER_ALGO_TKIP,
DOT11_CIPHER_ALGO_CCMP,
DOT11_CIPHER_ALGO_WEP104,
DOT11_CIPHER_ALGO_WPA_USE_GROUP,
DOT11_CIPHER_ALGO_RSN_USE_GROUP,
DOT11_CIPHER_ALGO_WEP,
DOT11_CIPHER_ALGO_IHV_START,
DOT11_CIPHER_ALGO_IHV_END
}DOT11_CIPHER_ALGORITHM, *PDOT11_CIPHER_ALGORITHM;
|
|
|
|
|
Hi,
when the API expects an array of structs, with unknown array length, one way to get
it working is:
- use IntPtr
- cast it while calling Marshal.PtrToStructure
The following class uses these techniques when calling NetWkstaGetInfo():
#if !NET11 && !NET20
#error "Missing version of .NET Framework (define one of NET11, NET20)"
#endif
using System;
using System.DirectoryServices;
using System.Management;
using System.Net;
using System.Runtime.InteropServices;
using System.Threading;
using LP_Core;
namespace LP_Platform {
public class LP_Workgroup {
protected static ILP_Environment env=LP_Environment.GetEnvironment();
protected string name;
public LP_Workgroup() : this(null) {}
public LP_Workgroup(string name) {
if (name==null) {
name="<unknown>";
IntPtr buf;
int result=NetWkstaGetInfo(null, 100, out buf);
env.log(0,"NetWkstaGetInfo result="+result);
if (result==0) {
WKSTA_INFO_100 info=(WKSTA_INFO_100)Marshal.PtrToStructure(buf, typeof(WKSTA_INFO_100));
name=info.wki100_langroup;
env.log(0,"LP_Workgroup: workgroup="+name);
}
if (buf!=IntPtr.Zero) NetApiBufferFree(buf);
result=NetWkstaUserGetInfo(null, 1, out buf);
env.log(0,"NetWkstaUserGetInfo result="+result);
if (result==0) {
WKSTA_USER_INFO_1 info=(WKSTA_USER_INFO_1)Marshal.PtrToStructure(buf, typeof(WKSTA_USER_INFO_1));
string s1=info.wkui1_username;
env.log(0,"LP_Workgroup: username="+s1);
string s2=info.wkui1_logon_domain;
env.log(0,"LP_Workgroup: logon domain="+s2);
string s3=info.wkui1_oth_domains;
env.log(0,"LP_Workgroup: other domains="+s3);
string s4=info.wkui1_logon_server;
env.log(0,"LP_Workgroup: logon server="+s4);
}
if (buf!=IntPtr.Zero) NetApiBufferFree(buf);
}
this.name=name;
}
public string Name {get {return name;}}
public void Scan(LPW_ProgressMessage msg) {
msg.Title="Searching machines in workgroup "+name;
env.alert(msg);
env.outputBegin();
LP_CancellableThread thread=new LP_CancellableThread(msg);
thread.Start(new LP_ObjectHandler(scanner), msg);
}
private void scanner(object arg) {
LPW_ProgressMessage msg=arg as LPW_ProgressMessage;
env.output("Searching machines in workgroup "+name);
DirectoryEntry domainEntry=new DirectoryEntry("WinNT://"+name);
domainEntry.Children.SchemaFilter.Add("computer");
int NAMELEN=0;
foreach(DirectoryEntry machine in domainEntry.Children) {
int i=machine.Name.Length+1;
if (i>NAMELEN) NAMELEN=i;
}
foreach(DirectoryEntry machine in domainEntry.Children) {
msg.Progress(1);
string machineName=machine.Name;
string longname=machineName.PadRight(NAMELEN);
env.log(0,"machineName="+machineName);
IPHostEntry hostEntry=null;
try {
#if NET11
hostEntry=Dns.GetHostByName(machineName);
#elif NET20
hostEntry=Dns.GetHostEntry(machineName);
#endif
} catch(Exception exc) {
env.output(" "+longname+" unable to connect ("+exc.Message+")");
}
if (hostEntry!=null) {
IPAddress[] IPAS=hostEntry.AddressList;
foreach(IPAddress IPA in IPAS) {
msg.Progress(1);
string IP=" IP="+IPA.ToString().PadRight(16);
env.log(0, IP);
byte[] ab=new byte[6];
int len=ab.Length;
byte[] b=IPA.GetAddressBytes();
int IPAadr=(((((b[0]<<8)|b[1])<<8)|b[2])<<8)|b[3];
int r=SendARP(IPAadr, 0, ab, ref len);
string MAC=" MAC="+BitConverter.ToString(ab, 0, 6);
env.log(0, MAC);
env.output(" "+longname+IP+MAC);
longname=" ".PadRight(NAMELEN);
}
}
}
#if true
env.output("All entries");
domainEntry=new DirectoryEntry("WinNT://"+name);
DirectoryEntries children=domainEntry.Children;
foreach(DirectoryEntry entry in domainEntry.Children) {
try {
env.output(" properties of "+entry.Name);
PropertyCollection props=entry.Properties;
foreach(string s in props.PropertyNames) {
object obj=props[s].Value;
env.output(" "+s+"="+obj.ToString());
}
} catch(Exception exc) {
env.output(" Exception: "+exc.Message);
}
}
#endif
aha();
env.outputEnd();
msg.Done(true);
}
public void aha() {
env.output("PRINTERS");
ManagementScope mgmtscope=new ManagementScope(@"\root\cimv2");
mgmtscope.Connect();
ManagementObjectSearcher objsearcher=new ManagementObjectSearcher(
"Select * from Win32_Printer");
foreach(ManagementObject printer in objsearcher.Get()) {
string printername=printer["Name"].ToString();
env.output(" "+printername);
foreach(PropertyData pd in printer.Properties) {
env.output(" "+pd.Name+"="+pd.Value);
}
}
}
[DllImport("Netapi32.dll", ExactSpelling=true)]
public static extern int NetWkstaGetInfo(
string servername,
int level,
out IntPtr buf
);
[DllImport("Netapi32.dll", ExactSpelling=true)]
public static extern int NetWkstaUserGetInfo(
string reserved,
int level,
out IntPtr buf
);
[DllImport("Netapi32.dll", ExactSpelling=true)]
public static extern int NetApiBufferFree(IntPtr buf);
[DllImport("iphlpapi.dll", ExactSpelling=true)]
public static extern int SendARP( int DestIP, int SrcIP, [Out] byte[] pMacAddr, ref int PhyAddrLen);
[StructLayout(LayoutKind.Sequential)]
public struct WKSTA_INFO_100 {
public int wki100_platform_id;
[MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr)]
public string wki100_computername;
[MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr)]
public string wki100_langroup;
public int wki100_ver_major;
public int wki100_ver_minor;
}
[StructLayout(LayoutKind.Sequential)]
public struct WKSTA_USER_INFO_1 {
[MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr)]
public string wkui1_username;
[MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr)]
public string wkui1_logon_domain;
[MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr)]
public string wkui1_logon_server;
[MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr)]
public string wkui1_oth_domains;
}
}
}
|
|
|
|
|
Hi Folks,
I have been a CodeProject Subscriber for a while, and have never needed forum help, But Here goes:
I have been an AMX Netlinx and Crestron Programmer for about 10 years, so I have a vast knowledge of the Proprietery Access, Netlinx, and Simpl+ Programming languages that are very much like C++. I have recently started using another program called StarDraw that the programming language is By-the-Book C#. I am pretty good at assimilating what I know to the C# language, But I am having trouble with some of the syntax and Structure...i.e., I can make controllable actions, but now I am trying to parse text coming back from devices, and wanting to put that text into buffers. I think I need a really good primer or tutorial on C#. Can anyone recommend and good book or a class I can take online to help me along?
Much Thanx,
RedNexHex
|
|
|
|
|
Hope this Link will help you. And there are lot of books are also mentioned there,
Online Tutorials[^]
Regards,
Satips.
|
|
|
|
|
|
hi guys
how can i call a Executable (eg.CMD.EXE) in a way that before the executable starts , Vista will bring up the UAC and ask the user to Cancel or continue or enter password based on their account rights.
i know to run a process, Process.Start() is used, but how can i Demand Administrative rights for that process? thanx
|
|
|
|
|
|
ya runas was what i needed . thanx
|
|
|
|
|
My blocking tcp server looks something like
while (true)
{
recv = ns.Read(message, insertPtr, 1024);
if (recv == 0)
break;
insertPtr += recv;
}
As it is now, the client sends the data(of various sizes) and the client closing the socket when it is done, thus causing ns.Read to return zero.
My question: How can the client get ns.Read to return zero without
closing the socket? I'd like to have the server send some data back to the client without having to open a new socket.
|
|
|
|
|
How to store elemts from generic collection classes to an has table? am not sure about the question, correct me if am wrong.
The problem is, how could i able to know all the elements in TList<employees>?how to access all the elements from that Generic collection class?
|
|
|
|
|
|
If you are not sure about the question how can anyone be sure about what to answer
are you familiar with the 'foreach' keyword?
|
|
|
|
|