|
if you want to run a program with admin rights after login you can make a scheduled task.
I did it for remove c$ and admin$.
|
|
|
|
|
You can disable the administrative shares properly if you want.
http://en.wikipedia.org/wiki/Administrative_share#How_to_disable[^]
It's not really necessary though. They are only accessibly locally on the domain and you have to have local admin access on the PC to view them. If someone has local admin access, they could just log in and create any shares they wanted anyway. It isn't a security hole to all your files. We use them quite a bit, it's handy to get to log files and stuff without having to go to the PC, or remote in, or create a proper share.
Simon
|
|
|
|
|
good article thanks, but there is no in VISTA
Hive: HKEY_LOCAL_MACHINE
Key: SYSTEM\CurrentControlSet\Services\LanManServer\Parameters
Name: AutoShareWks
where is AutoShareWks?
modified on Friday, July 18, 2008 8:49 AM
|
|
|
|
|
You have to create it. (it's a DWORD type key)
Simon
|
|
|
|
|
Hey Guys,
I am a newbie to .NET and I need help with databinding a dropdown control at the backend(aspx.cs) file, also there is second part to it which is, based on the selection on the dropdown, the data on the grid view control needs to filtered. Sorry about the long description, please help!!!!!!
Thanks in advance.
Sam
|
|
|
|
|
Hi,
I my opinion i think you should make all your filters and sorts in SQL Store Procedures.
After that, trigger the SP´s in some kind of events; like the Button_Click or DropDown_SelectIndexChanged as in your case!!!
I assume that you are ok on making SP´s.
I don´t filter or sort data in C# but it is possible, my way works just fine!!!
Do it and if you became stuck ask here again
|
|
|
|
|
Thanks for the suggestion (sorry don't know your name). But I did it through C# code as follow:
ddlStatus.DataTextField = "Value";
ddlStatus.DataValueField = "key";
ddlStatus.DataSource = StatusList;
ddlStatus.DataBind();
I didn't have the datafields before since we are using the repository system here also I am new to using controllers and repository system. But thanks a lot for your reply. Catch up the next time!
S
|
|
|
|
|
I am porting a VB6 winsock.ocx based library to a .Net Sockets implementation, and I am not the most savvy sockets programmer. The architecture of the communication system was designed long before I got here; so changing the overall design is not an option. Moreover, this system has a low frequency of tcp traffic, so the Socket.Connected will almost always be out-of-date.
The fundamental issue is the connected property of the socket. It does not seem to be funcitonal; however, I have found others that have had similar issues http://msdn.microsoft.com/en-us/library/system.net.sockets.socket.connected.aspx[^]
When I stepping-through the code in the debugger, unplug the network at the right moment, and view the sock object with the quick watcher, it shows me the value of sock.Connected has changed to false as expected. However, while running the code below, in debug mode but not stepping-through, the behavior of sock.Connected is different (when I unplug the wire, it does not update to false).
Thoughts?
private bool isConnected(){
bool rVal = false;
try
{
bool blcking = sock.Blocking;
try
{
byte[] junk = new byte[2];
sock.Blocking = false;
sock.Send(junk, 1, 0, SocketFlags.None);
rVal = sock.Connected;
}
finally
{
sock.Blocking = blcking;
}
}
catch (SocketException e)
{
rVal = e.SocketErrorCode == SocketError.WouldBlock;
}
return rVal;
}
You can only be young once. But you can always be immature.
- Dave Barry
|
|
|
|
|
Hi,
I don´t know that i think, but do you know about Asynchronous connections? If not read about it!
Maybe because you are not using that your sockets blocks.
Check out the way you managed your threads maybe because you are invoking a wrong thread!
Sorry i can´t help you more!
|
|
|
|
|
Well - Thanks for your input anyways
You can only be young once. But you can always be immature.
- Dave Barry
|
|
|
|
|
Hello,
I'm having difficulty signing a string using the RSA cryptography algorithm.
I've search here in this forum for sample code, but I guess, signing is not that popular.
Anyway, any help would be greatly appreciated.
here is my code.
public static string SignMyData(string data2Sign)
{
AssignPr();
byte[] byte2Sign = System.Text.Encoding.UTF8.GetBytes(data2Sign);
StreamReader reader = new StreamReader(@"C:\MyPrivateKey.xml");
string pubPriKeyXML = reader.ReadToEnd();
rsa.FromXmlString(pubPriKeyXML);
reader.Close();
byte[] byteSig = rsa.SignData(byte2Sign, "SHA1");
return System.Text.Encoding.UTF8.GetString(ByteSig);
}
If anyone knows of a simple tutorial or can guide me through this, that would be great
Thanks
JC
|
|
|
|
|
nyjcr wrote: rsa.FromXmlString(pubPriKeyXML);
'rsa' seems to be a non-static member variable. You cannot use non-static member variables in static methods. Try changing your method to a non-static one.
|
|
|
|
|
|
|
Hi,
Can anyone help me here to translate this? It´s from a help file that is only coded in vb.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
CType(objForm, Form1).Label2.Text = TextBox1.Text
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim MyForm As New Form2()
MyForm.objForm = Me
MyForm.SetBounds(400, 400, 300, 300)
MyForm.Show()
End Sub
Public Property Form2Value() As String
Get
Return MyVal
End Get
Set(ByVal Value As String)
MyVal = Value
End Set
End Property
Thanks
|
|
|
|
|
Don't cross-post. It's considered rude and isn't going to help you get an answer to your question any faster. The original post is here[^].
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|
|
The weirdness continues unabated.
I've written an app that downs files via the WebClient object, using the DownloadFileAsync method.
Immediately after processing the call to DownloadFileAsync, the application terminates. I've verified that both the uri and the target filename I'm passing are valid. This does not happen on anyone else's machine.
I've got event handlers setup, but they're not hit at all. Also, the call to DownloadFileAsync is contained within a try/catch block and I'm not getting any indication of an exception.
"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." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: Immediately after processing the call to DownloadFileAsync, the application terminates
Without any error message ? Have you looked at the event viewer for any error report.
John Simmons / outlaw programmer wrote: Also, the call to DownloadFileAsync is contained within a try/catch block and I'm not getting any indication of an exception.
Since it's an asynchronous operation, your catch block can't handle exceptions as the file download will be happening on a separate thread.
|
|
|
|
|
N a v a n e e t h wrote: Without any error message ? Have you looked at the event viewer for any error report.
Yeah, checked that - nothing there.
Another weird aspect of this is that I wrote a very simple app that downloads a file (from the same server, no less) using WebClient.DownloadFileAsync, and it works fine. I even used the code from the app that doesn't work. How bizarre is that?
"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." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hello Guys..
I am currently working on a project where I am suppose to read High R3es MultiPage Tiff images.
I am able to display the First page But I dont know hot to Loop tru the multiple pages in perticuler Image file.
If Anyone can explain.. tat will be gr8!!
Environment : .net 3.5
Thanks,
Niks
|
|
|
|
|
I was also looking for something like this, where I could handle individual pages of a multipage tiff and re order them (move first page to the back or remove it - cover sheets, etc).
This may allow you to iterate through the pages, but for me it was blowing up badly when I tried using the Bitmap.SaveAdd method to save the pages (GDI+ Exception). You may have better luck if you don't need to save these.
frameDimension = System.Drawing.Imaging.FrameDimension.Page
pageCount = inputFile.GetFrameCount(frameDimension)
For x As Integer = 0 To pageCount - 1
'set page x as the active frame
inputFile.SelectActiveFrame(frameDimension, x)
nextPage = New System.Drawing.Bitmap(inputFile) 'may need overload for size
'outputBitmap.SaveAdd(nextPage, encParams) <--blows up on me... you may not need to worry about it.
Next 'x
The best thing I could come up with to SAVE images was to use iTextSharp and do something like this... (copy and paste - I am doing many other things in between these lines ). You may not need this, but here it is anyway.
bmpImage = New System.Drawing.Bitmap(InputTIFFFile)
intTIFFPages = iTextSharp.text.pdf.codec.TiffImage.GetNumberOfPages(objRA)
For c As Integer = 0 To intTIFFPages - 1
objImage = iTextSharp.text.pdf.codec.TiffImage.GetTiffImage(objRA, c + 1)
'Do stuff with your images here.
Next 'c
These are all from 1.1 framework.
modified on Friday, July 18, 2008 7:22 AM
|
|
|
|
|
Hello Astanton,
thanks for reply.
I am able to iterate tru the diff pages of Tiff, but the problem I am facing is I want to dispay each frame as I go along..
Like Next and Back bottons will allow me to move with the frams. I was not able to get the file reference.
Say, I have the below code,
string tifimgFileNM = "c:\\images\\test.tif";
Bitmap tifImg = new Bitmap(tifimgFileNM);
int pageCount = tifImg.GetFrameCount(FrameDimension.Page);
if (pageCount > 1)
{
for (int i = 0; i < pageCount; i++)
{
tifImg.SelectActiveFrame(FrameDimension.Page, 0);
Bitmap img = (Bitmap)tifImg.Clone();
}
}
Now @ //XXXXXXXXXXXXXXXX, i want to assign selected Frame image to Picture Box. HOw I am suppose to do tat.. normally we can write
PictBox.Load("c:\\images\test.tif");
how Can i refer it here..??
THanks,
Niks
|
|
|
|
|
Dig this....
http://www.bobpowell.net/addframes.htm[^]
Basically he explains that you can do something like this....
int pageCount;
int curPage;
List<bitmap> tifPages;
private void Form1_Load(object sender, EventArgs e)
{
string tifimgFileNM = ".\\multipage.tif";
Bitmap tifImg = new Bitmap(tifimgFileNM);
pageCount = tifImg.GetFrameCount(FrameDimension.Page);
tifPages = new List<bitmap>(pageCount);
if (pageCount > 1)
{
for (int i = 0; i < pageCount; i++)
{
tifImg.SelectActiveFrame(FrameDimension.Page, i);
Bitmap tmp = new Bitmap(tifImg.Width, tifImg.Height);
Graphics g = Graphics.FromImage(tmp);
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
g.DrawImageUnscaled(tifImg, 0, 0);
g.Dispose();
tifPages.Add(tmp);
}
}
curPage = 0;
PictBox.Image = tifPages[curPage];
PictBox.Refresh();
lblPageNo.Text = "Page " + Convert.ToString(curPage + 1) + " of " + Convert.ToString(pageCount);
}
private void btnNext_Click(object sender, EventArgs e)
{
curPage++;
if (curPage + 1 > pageCount)
{
btnNext.Enabled = false;
}
else
{
btnNext.Enabled = true;
}
PictBox.Image = tifPages[curPage];
PictBox.Refresh();
lblPageNo.Text = "Page " + Convert.ToString(curPage + 1) + " of " + Convert.ToString(pageCount);
}
private void btnPrev_Click(object sender, EventArgs e)
{
curPage--;
if (curPage - 1 < 0)
{
btnPrev.Enabled = false;
}
else
{
btnPrev.Enabled = true;
}
PictBox.Image = tifPages[curPage];
PictBox.Refresh();
lblPageNo.Text = "Page " + Convert.ToString(curPage + 1) + " of " + Convert.ToString(pageCount);
}
}
</bitmap></bitmap>
|
|
|
|
|
I am senting data in a flat file to a client who is parsing the data using Cobol and he is
asking me to format money with an implied decimal point padded to 6 charaters in length.
For example given $15 dollars he wants me to send either
001500 or 1500 I am not sure which yet but the problem is the same either way.
I have a generic tool that allows me to pick a field to send and also to provide the
formating to apply.
Here is the method I call each time a number needs to be formatted:
static public string ProcessNumber(string amount, string format)
{
decimal temp;
bool results = decimal.TryParse(amount, out temp);
if(results)
{
string localFormat = string.IsNullOrEmpty(format) ? "0.00" : format;
string convertedValue = temp.ToString(localFormat);
return convertedValue;
}
return amount;
}
Normally, for money I would use the "0.00" or "000.00" format specifier when
yields 15.00 or 015.00 respectively.
I don't want to have to treat this request as a one off and write special code if I don't have to.
I can't assume in any given case that the decimal will or won't be implied.
Is there a way to apply a format to yield a textual representation of a number with an implied decimal place?
|
|
|
|
|
Multiply by one hundred?
amount.Replace ( "." , "" ) ?
|
|
|
|