|
hi all,
I need to know How to edit and manage group policy through C# and ASP.Net application.I want to get all users an groups in the active directory and I already did this.I then want to assign group ploicy to groups and OU(organizational unit).
I&S
|
|
|
|
|
This question isn't really answerable is a forum environment. The description of everything you ahve to do would be a larger article or a small books worth. Far beyond the capacity of a few forum posts. All I can do is direct you to start researching the System.DirectoryServices namespace to get an understanding of the classes you're going to use to manipulate Active Directory. From there, you can come up with a design for your ASP.NET app.
|
|
|
|
|
Thanks Dave Kreskowiak
I searched for Active Directory services and read a book about it and the group policy(GPO scripting of it).
|
|
|
|
|
Hello
My problem is updating multiple rows of a single column with different using update command from C#
Regards Usman Ahmad
|
|
|
|
|
Would you care to actually explain the problem and the code you're using or should we just guess at the million or so possible issues you have?
|
|
|
|
|
Thanks to every one who replied me. I have solve the problem.
regards
Usman Ahmad
|
|
|
|
|
Hi Guys,
i need the NewRowNeededEvent of the DataGridView. So i set the VirtualMode Property to true.
But if this property is set to true, i need to set the cell value by myself, otherwise it vanisches if i leave the cell.
So i've tried to save the value - the cell is a ComboBox where i select a value - in the CellValidatinEvent.
But it doesnt work. The value property of the cell is not changing it is still null.
Here is some code that you can understand what i mean.
<br />
<br />
private void aufwandDataGridView_CellValidating(object sender, DataGridViewCellValidatingEventArgs e)<br />
{<br />
DataGridViewComboBoxCell cell =<br />
aufwandDataGridView.CurrentCell as DataGridViewComboBoxCell;<br />
<br />
cell.ReadOnly = false;<br />
<br />
if (aufwandDataGridView.IsCurrentCellDirty)<br />
{<br />
<br />
aufwandDataGridView.CommitEdit<br />
(DataGridViewDataErrorContexts.Commit);<br />
}<br />
<br />
cell.Value = e.FormattedValue;<br />
}<br />
Can anyone please help me?
Kind regards and thx in advance
Me
|
|
|
|
|
Ok it's because of the VirtualMode property that i can't set the cell.value so easily.
But how can i set the cell.value if the cell is not databound?
|
|
|
|
|
Ok i've given up on virtual mode.
now i search for an event that occurs at the same time like newrowneeded
|
|
|
|
|
hi
at first excuse me because of my poor english i have written a program for sending an image or for video conference via internet with sockets and i am using tcp protocols my problem is that when i test program on my computer it works fine but when i test it over internet with between two pcs the reciver cant recieve image correctly minwhile i am using dial up
connection i dont know where is the problem perhaps it is because of low speed of internet i changed the buffer size to 512 1024 4096 and it didnt change. or i maybe should compress or encode image i dont know .please please help me with this problem.
here is the code for sending an image :
private void button2_Click(object sender, EventArgs e)
{
byte[] bytes;
using (MemoryStream ms = new MemoryStream())
{
pictureBox1.Image.Save(ms,ImageFormat.Jpeg);
pictureBox2.Image = pictureBox1.Image;
bytes = ms.ToArray();
ms.Close();
}
startcapturing(bytes);
}
private void startcapturing(byte[] bytes)
{
int i = 0;
byte[] dataBuffer = new byte[128];
int index = 0;
byte[] loop = new byte[128];
loop = System.Text.Encoding.ASCII.GetBytes(((bytes.Length / 128) + 1).ToString());
label4.Text = ((bytes.Length / 128) + 1).ToString();
if (serverSocket != null)
{
try
{
rc = clientSocket.Send(loop, SocketFlags.None);
while(i<bytes.length)
{
="" for="" (index="0;" index="" <="" databuffer.length;="" index++)
="" if="" (i="">= bytes.Length)
{
dataBuffer[index] = 0;
}
else
{
dataBuffer[index] = bytes[i];
i++;
}
}
rc = lientSocket.Send(dataBuffer,SocketFlags.None);
}
}
catch (Exception err)
{
MessageBox.Show(err.Message.ToString()+"here");
}
}
}
here is the code for client to recieve image:
if (clientSocket != null)
{
while(true)
{
while (true)
{
int counter = 0;
msr = new MemoryStream();
byte[] recv = new byte[128];
try
{
rc = clientSocket.Receive(recv, SocketFlags.None);
try
{
counter = Convert.ToInt32(System.Text.Encoding.ASCII.GetString(recv, 0, recv.Length));
}
catch { }
while (counter > 0)
{
rc = clientSocket.Receive(recv, SocketFlags.None);
counter--;
msr.Write(recv, 0, recv.Length);
}
}
catch (Exception e)
{
}
try
{
pictureBox1.Image = Image.FromStream(msr);
msr.Close();
}
catch(Exception e)
{
}
break;
}
}
}
else
{
StatusLabel1.Text = "Unable to establish connection to server!";
BtnDC_Click(null, null);
}
}
i beg you help me
|
|
|
|
|
I don't understand the full code, but I must say the problem is probably with the send or the Receive.
I am not sure if the Send can send partial data, but receive surelly do.
For example: You send 128 bytes.
The connection is local, you get 128 bytes.
But, if the connection is remote, you can:
Receive 10 bytes.
Then, receive 20 bytes.
+ 10 bytes... until you finally receive all the buffer (the 128 you expected).
So, you must check this.
Also, I think a better approach is:
Instead of writing everything to a memorystream and them sending the memorystream buffer, get the socket stream (socket.GetStream()) and save the image directly to the socket stream.
Then, on the other side, call Image.FromStream(socket.GetStream())
|
|
|
|
|
thanks sockets doesnt have Getstream() methode only tcp client has it
please if you guide me write more cause i am new to c#
thanks in advance
|
|
|
|
|
Well... I usually use sockets by TcpClient in C#... but, the same way, I am not sure about send, but when reading, you must do something like this:
Instead of read(buffer, 0, 128)
you set:
int totalRead = 0
int count = 128;
while(count > 0)
{
int actualRead = socket.Read(buffer, totalRead, count);
if (actualRead <= 0)
throw new Exception("Connection lost");
totalRead += actualRead;
count -= actualRead;
}
|
|
|
|
|
ohhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
oh my god you solved my problem oh my god thank you thank you thanks
please please let me kiss your foot
i wont forget your name paulo zemek i wont forget you
thanks thanks a milion thanks a bunch
let me let me kiss your foot
i am really crying here
thanks thanks ..................................
................................................
.................................................
..................................................
...................................................
|
|
|
|
|
Hi,
I have coded few methods in C++ language. These methods are to be used in C#.NET . I guess I need to convert the .CPP file(C++ code) into DLL and then import the methods in C#.
I made a Win32 project and converted the exe(C++ code) into unmanaged C++ DLL.
Then I tried to call its method in C#.NET as :
using System.Runtime.InteropServices;
public partial class CDLL : System.Web.UI.Page
{
[DllImport("C:\\Project1\\TestProject\\Debug\\TestProject.dll", EntryPoint = "testMethod", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
public static extern void testMethod();
protected void Page_Load(object sender, EventArgs e)
{
testMethod();
}
}
After running the above code i am getting error like : Unable to find an entry point named 'testMethod' in DLL 'C:\Project1\TestProject\Debug\TestProject.dll'. Can any one suggest how to run the above code successfully.
Thanks.
|
|
|
|
|
Pranav Thakur wrote: After running the above code i am getting error like : Unable to find an entry point named 'testMethod' in DLL 'C:\Project1\TestProject\Debug\TestProject.dll'. Can any one suggest how to run the above code successfully.
Write a dll that exports testMethod, that's what the error is telling you.
I would also not use full paths, just let the dll be in the same dir as the exe.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
C++ mangles names. Declare your exported C++ functions like this:
extern "C"
{
__declspec(dllexport) int Function( ... );
}
Nick
----------------------------------
Be excellent to each other
|
|
|
|
|
I have a dll file. The dll file has functions like that
"typedef short apiStatus;
apiStatus __declspec(dllexport) __stdcall DrfCommOpen (HANDLE * hCom, char *com_port);"
how i can call and use this function in my c#.net application?
thanks in advance..
regards..
|
|
|
|
|
I got a bug in the application which is as follows
When i am doing login to my application, welcome window will come with the login name and at the same time the update page will also be shown minimized... at this time i can do the modification in name and i press the update button it will make the changes to the welcome window.. but when i close this update page and reopen the same.. and i perform the same task again. it is not getting updated in the welcome window..
Any idea for this bug to be cleared..
|
|
|
|
|
Fix your code. Hard to say more, based on your description. Post some code perhaps, explain how you've used the debugger to diagnose the issue, etc.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Im doing some operations in BackgroundWorker's DoWork event. So when I call the following line, it works good but when I call second one it shows "Cross-thread operation not valid" error.
backgroundWorker1.ReportProgress(((b + 1) * 100) / listView1.Groups[a].Items.Count, new object[] { 1, listView1.Groups[a].Items[b].SubItems[0].Text });
backgroundWorker1.ReportProgress(((b + 1) * 100) / listView1.Groups[a].Items.Count, new object[] { 1, listView1.Groups[a].Items[b].Index });
I know how to fix this error. But my question is why its not raising with first line ??
I tried with DGV and it works good.
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
I am working on window application.
On a list view i am storing names of file.
when we double click a file in widows folder, the file gots open into its default application. (as suppose there is text file, and we click it, then it got opened in notepad).
Is there way to achieve the same with in application. So that user click on file name, and file got opened in its application.
any help/link much appreciated.
regards,
|
|
|
|
|
Hum Dum wrote: Is there way to achieve the same with in application. So that user click on file name, and file got opened in its application.
You mean associate a file with your app ? That's done in the registry, and your app needs to take a file path on the command line and open it.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Christian Graus wrote: You mean associate a file with your app ?
Not really......!!
when we double click a file say of any extension, it got opened in its application(which is associated with it).
i just want that. I am storing filename only (file remain in a folder), and wants when user click on the filename. It got opened.
Or say just making a list of file present in specific folder(wheteher its .txt, .rtf, .doc, .pdf etc).
Now just wants whenever user click on particular filename, it got opened(not go to that folder and fron there open that file).
regards
|
|
|
|
|
There is an article here at CP which shows how to do file association. Search for it.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|