|
I've been searching for this code all over the internet! Thanks so much!
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
_beauw_ wrote: It's not multi-threaded, though
I hate myself for laughing so much - but thanks for cheering me up!
It is an absolute certainty that there are no certainties. ~ Christopher Hitchens 1949-2011
|
|
|
|
|
Can u plz give in VB.NET. Need urgent, plzzzzz
No comment
|
|
|
|
|
vandhana.venugopalan wrote: Hey can nyone help me how to write code for creating an online employee's attendance marking system?
That has been available as a starter-kit[^] for a long time.
Bastard Programmer from Hell
|
|
|
|
|
First do some design for your problem, then decide where do you wish to store like DB, File, etc. Then UI for the app.
In design, figure out all the classes you require to do attendance system. Then go on with the coding.
|
|
|
|
|
By learning C# Languages.
|
|
|
|
|
Hello everyone,
I've been searching all over the place (here + Google) and with no luck.
I have a UNC I need to authenticate to and copy a file to that path (and then read it to double check it was copied).
(My problem is obtaining a connection to the path).
For example:
Path: //Server/FTP
Domain: Office
User: FTPuser
Password: FTP123
I've tried to use the class mentioned here [^]
combining with this:
static void Main(string[] args)
{
string strHostname = "Server";
string strUsername = "Office\FTPuser";
string strPassword = "FTP123";
RemoteCredentialsClass rc = new RemoteCredentialsClass(@"\\" + strHostname + @"\c$\", strUsername, strPassword);
try
{
StreamWriter SW = new StreamWriter(@"\\" + strHostname + @"\c$\Test.txt");
SW.WriteLine("This is a test");
SW.Close();
}
finally
{
rc.CloseUNC();
}
}
On this attempt I get: "
Access to the path '\\server\c$\Test.txt' is denied."
Thanks for anyone who can provide me any kind of help.
modified 28-Dec-11 5:41am.
|
|
|
|
|
Some ideas:
- Writing to C:\ may be denied for whatever reasons. Try to write to a shared directory, and check that you can write to that share e.g. with Windows explorer
- I'd create a temporary file on the local computer, then copy it to the share, verify that it is there, then delete the local temporary file.
- It could be necessary to use "Impersonation".
|
|
|
|
|
When you write to a UNC path, you need permissions on that path to be able to do so. Talk to your system admin about adding you to an appropriate group.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "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
|
|
|
|
|
plz send this project to my id its very emergency my id is mcapriya2011@gmail.com
|
|
|
|
|
No.
Two reasons:
1) Never post your email address in any forum, unless you really like spam! If anyone replies to you, you will receive an email to let you know
2) We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action. Try it yourself, you may find it is easier than you think.
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
What have you tried so far? If you have done something and you have a problem with your work, then post your problem here and we will be glad to help you.
priyashankaran wrote: plz send this project to my id
No one will do the work for you unless you pay them.
priyashankaran wrote: its very emergency
For you, not for us. We are professionals who have got a job to do. We visit CP in our leisure to help the developer community.
priyashankaran wrote: my id is
Happy spam.
|
|
|
|
|
I suggest you read the forum guidelines!
|
|
|
|
|
Go here [^]
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "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
|
|
|
|
|
priyashankaran wrote: send this project to my id
Sorry this kind of facility is not available here
better to learn C# languages and try to make it by yourself.
|
|
|
|
|
Hi all,
Hope my title explains the all.
I want to control the plug-unplug USB devices programatically, rather manually doing this. Found lots of articles on how to unplug, not other way round. Anybody of you have an idea about it.
Thanks
I appreciate your help all the time...
CodingLover
|
|
|
|
|
I believe that the only way to plug back a device after it has been programatically unplugged is to physically remove the USB device and plug it back again.
|
|
|
|
|
You can use WMI queries to check USB device is plugged or unplugged.
void StartEventWatcher()
{
try
{
WqlEventQuery query = new WqlEventQuery("SELECT * FROM Win32_DeviceChangeEvent");
watcher = new ManagementEventWatcher(query);
Console.WriteLine("Waiting for an event...");
watcher.EventArrived += new EventArrivedEventHandler(HandleDeviceChangeEvent);
// Start listening for events
watcher.Start();
}
catch (ManagementException err)
{
MessageBox.Show("An error occurred while trying to receive an event: " + err.Message);
}
}
private void HandleDeviceChangeEvent(object sender, EventArrivedEventArgs e)
{
IsDeviceConnected()
}
Boolean IsDeviceConnected()
{
ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2",
"SELECT * FROM Win32_USBDevice");
foreach (ManagementObject queryObj in searcher.Get())
{
if (queryObj["Description"].ToString() == "Write the name of USB device";)
{
return true;
}
}
return false;
}
WMI is use full , It we can directly write query to OS , to get required information form OS.
Regards,
Somnath Avhad.
|
|
|
|
|
Member 8064748 wrote: WMI is use full , It we can directly write query to OS , to get required information form OS.
True, I can get all the plug-unplug sate. But I cannot unplug a device with WMI.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
Always wrap your code in Pre tag.
|
|
|
|
|
What does a device do when it is programmatically unplugged?
Some devices switch off - how could you plug it programmatically?
Some devices connect in a different mode to receive electricity via the USB port for charging their internal batteries (e.g. connect a "HID keyboard"). In such cases, the SDK of the manufacturer could provide a function to switch the device to its "normal" connected mode.
|
|
|
|
|
|
We have a set (~50) of local mode reports hosted in forms as plugins (dlls) in our app.
They were initially developed in VS2005 and later ported to VS2008.
We are now attempting to get them working in VS2010.
The reports use lists to iterate over a table, invoking a subreport with the ID (primary key) as a variable/parameter so that the subreport could select details from related tables and display them.
Some of the subreports used lists and sub-subreports, on and on.
However, as of VS2010, even once we get the reports building and running they don't work properly.
When we attempt to assign parameters to a subreport in the parent reports' design[er] using
Right-click ->
Subreport Properties ->
Parameters ->
Fields
Then either...
Add to create a new one or
f[unction] to edit one that's broken...
We get "Report item not linked to a dataset."
This happens even if the Field (name) appears in the "Value" combobox and we select it.
Does anyone know how to fix this or get past it...
|
|
|
|
|
hey guys!
does anybody have any experience
in C# ? i would need to read data (numbers) from
*.txt file and plot them in ZedGraph in Csharp
it is easy to make a plot of equestion
but i am suppose to plot bar graph like that:
v1 v2 v3 v4 v5
0122 4466 2847 2640 82800
0122 4466 2847 2640 82801
0122 4466 2847 2640 82802
0122 4466 2847 2640 82803
0122 4468 2847 2640 82804
0122 4468 2847 2640 82805
0122 4466 2847 2640 82806
0122 4466 2847 2640 82807
the task is easy, plot every
column seperately like bar
histogram. i have no idea
how to read data from .txt
i am a beginner and it´s
really important for me.
thx!
|
|
|
|
|
This sounds a lot like homework, so I won't give you full code!
Having said that, it's not a complex task, if you just break it down into the various parts:
1) Read data from text file
2) Convert data to numbers
3) Plot data
It's never that simple, though, because 2 and 3 will have some relationship, because ZedGraph will define what it want's in the form of data.
But the principles are the same.
1) Reading from a text file: easy!
string[] lines = File.ReadAllLines(pathToFile); That's it - all done.
2) Convert to numbers: Not too difficult.
First you need to repeat some action for each line, and convert a line into the various values to be plotted. Since your data appears to be separated by spaces, it would make sense to split teh line up on those and then convert the relevant numbers only.
Set up a foreach loop to work on each line of lines above (the info will be in your notes).
For each line, split iot on a space:
string[] parts = line.Split(' '); This gives you an array of separated values, as strings. It looks like you want to plot the second and fifth values since they are the only ones changing. So the strigns you will need to convert to numbers are parts[1] and parts[4] since C# always starts numbering at zero, not one.
To convert a numeric string to a numeber, use int.Parse:
int value = int.Parse(numericString); For example:
int value = int.Parse("123"); Would give you the number one hundred and twenty-three in the variable value
3) Put the values together, and pass them to ZedGraph.
This bit is up to you - I don't use ZedGraph and don't want to look up for you how it expects it's data - you probably have some notes giving you a short cut on that anyway!
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|