|
Greetings,
I'm using a crystal report and using it to make a sales report and I want to sort the reports displayed based on the date of the sales order what I should do I create a parameter field and its type is Boolean what else I should do what is the formula to write to do such sorting
|
|
|
|
|
|
As an alternative to the other suggestion you might consider retrieving the data from the data store so it is already sorted.
|
|
|
|
|
Hey, I am trying to make an application that allows me to connect to a proxy server through a c# console application but I am not sure how.What I want to achieve is the program selects a random IP from the list in a text file and opens up google using the chosen proxy IP, I want to use it in school because the website restrictions are completely broken, most websites are blocked for either sales or occult. I've been looking around on the web and I found a few things like HttpWebRequest and HttpWebResponse but I don't know how to use it, could someone link me to a website that explains this kind of thing or explain it on here please.
I've got this but its probably completely wrong.
In ProxyIps.txt there is a large list of proxy IP addresses.
<br />
using System;<br />
using System.Collections.Generic;<br />
using System.Linq;<br />
using System.Text;<br />
using System.IO;<br />
using System.Net;<br />
<br />
namespace FirstWebProxy<br />
{<br />
class Program<br />
{<br />
static void Main(string[] args)<br />
{<br />
Console.WriteLine("Available proxys:");<br />
<br />
string[] lines = System.IO.File.ReadAllLines(@"C:\Users\user0\Documents\Visual Studio 2010\Projects\FirstWebProxy\ProxyIps.txt");<br />
<br />
foreach (string line in lines)<br />
{<br />
<br />
Console.WriteLine("\t" + line);<br />
}<br />
<br />
Console.WriteLine("Would you like to connect to a random server? Type Y or N");<br />
string r = Console.ReadLine();<br />
<br />
if (r =="Y" || r =="y") {<br />
<pre lang="cs">var p = new Random();<br />
var randomLineNumber = p.Next(0, lines.Length - 1);<br />
var host = lines[randomLineNumber];<br />
<br />
string url = "http://www.google.com/";<br />
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);<br />
WebProxy myproxy = new WebProxy(host, false);<br />
request.Proxy = myproxy;<br />
request.Method = "GET";<br />
HttpWebResponse response = (HttpWebResponse)request.GetResponse();<br />
}<br />
<br />
}<br />
}<br />
}<br />
<br />
Thanks in advance.
|
|
|
|
|
Member 10521793 wrote: but its probably completely wrong. Why do you think so? What does happen instead of what you expect to happen? Any error messages? Any missing functionality?
|
|
|
|
|
HttpWebResponse response = (HttpWebResponse)request.GetResponse(); - unable to connect to remote server.And how do I open chrome using the proxy I'm requesting?
Thanks in advance.
|
|
|
|
|
Unable to connect: is the IP address of the proxy correct? Does the proxy need credentials?
Chrome: That's a question of how to configure Chrome, not a question of C# coding!
|
|
|
|
|
Hello everyone,
I am looking for script which online convert Kurti dev to uni code and uni code yo kurti dev convert by script in C#.
Please help me for the script. how to write or anyone have ready made script.
|
|
|
|
|
|
Thanks but I already checked it but it is not complete script so if you have complete script then let me know?
|
|
|
|
|
Nope. Better ask that author & also Google.
|
|
|
|
|
Hello,
I am asking myself for a couple of hours how I can work around the following problem.
It seems that I need to create my PDF by using "Document" instead of PdfStamper to get the size and rotation. But there are two problems I have with this.
- The Opacity seems not to work (Docu //Overlay Transperency)
- I can't figure out how I can decide if the overlay is in background or foreground.
With
PdfContentByte cb1 = outputWriter.DirectContent; it seems always to be in the foreground. I can also create the PdfContentByte with
PdfContentByte cb1 = outputWriter.DirectContentUnder;
but I can't figure out how I can do something like this ...
if (<condition>)
PdfContentByte cb1 = outputWriter.DirectContentUnder;
else
PdfContentByte cb1 = outputWriter.DirectContent;
This is my code.
string TempFileName = "";
TempFileName = Path.GetTempFileName();
FilePdfReader = new PdfReader(FileMemoryStream);
Document inputDoc = new Document(FilePdfReader.GetPageSizeWithRotation(1));
using (FileStream fs = new FileStream(TempFileName, FileMode.Create))
{
PdfWriter outputWriter = PdfWriter.GetInstance(inputDoc,fs);
inputDoc.Open();
PdfContentByte cb1 = outputWriter.DirectContent;
PdfReader overlayReader = new PdfReader(OverlayMemoryStream);
PdfImportedPage overLay = outputWriter.GetImportedPage(overlayReader, 1);
PdfGState GState = new PdfGState();
int overlayRotation = overlayReader.GetPageRotation(1);
int n = FilePdfReader.NumberOfPages;
int i = 1;
while (i <= n)
{
inputDoc.SetPageSize(FilePdfReader.GetPageSizeWithRotation(i));
inputDoc.NewPage();
PdfImportedPage page = outputWriter.GetImportedPage(FilePdfReader, i);
int rotation = FilePdfReader.GetPageRotation(i);
if ( (OverlayFillOpacity != 0f) || (OverlayStrokeOpacity != 0f) )
{
GState.FillOpacity = OverlayFillOpacity;
GState.StrokeOpacity = OverlayStrokeOpacity;
cb1.SaveState();
cb1.SetGState(GState);
}
if (overlayRotation == 90 || overlayRotation == 270)
{
cb1.AddTemplate(overLay, 0, -1f, 1f, 0, 0,
FilePdfReader.GetPageSizeWithRotation(i).Height);
}
else
{
cb1.AddTemplate(overLay, 1f, 0, 0, 1f, 0, 0);
}
if (rotation == 90 || rotation == 270)
{
cb1.AddTemplate(page, 0, -1f, 1f, 0, 0,
FilePdfReader.GetPageSizeWithRotation(i).Height);
}
else
{
cb1.AddTemplate(page, 1f, 0, 0, 1f, 0, 0);
}
i++;
}
inputDoc.Close();
overlayReader.Close();
|
|
|
|
|
Hi,
I have a form for the user to enter how many passengers to add.
I would like to enter txtFirstName, txtLastName, cbodateOfBrith and txtPassportNumber for the x number of passengers entered in the previous form.
so if the user choosed 4 then 4 rows of the controls should be added.
how can I do this in WinForm?
Technology News @ www.JassimRahma.com
|
|
|
|
|
Doesn't sound like a good design.
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
There are quite a few ways to do this, depending on your skill level and abilities:
1) You could create each control individually and add them in a row inside a panel
2) You could create a UserControl which has one of each of the controls you need and then add one of that for each passenger
3) You could use some grid based control instead - such as a DataGridView
But what you want is a bit...um...odd. The first thing which looks like a silly idea is "cbodateOfBrith" which I assume is a combobox for the date of birth. How many dates do you propose to put in that? 120 years worth?
Would you want to try and enter the date from that? Because I wouldn't! Consider a DateTimePicker instead...
And I wouldn't do it that way either: Instead of asking for the number of passengers, use a grid based control that the user can edit directly and let them add all the rows they need. This shows how to create a Calender control within a DataGridView: http://msdn.microsoft.com/en-us/library/7tas5c80.aspx[^]
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
When I am changing my design of my program and then run the program it's still using the previous design. I just seem to get it working, can someone help me cause I don't have a clue
Thanks
|
|
|
|
|
Are you rebuilding (i.e. recompiling) your app after you change it?
/ravi
|
|
|
|
|
|
The application (.exe file) is created after recompiling your source code. Simply changing your code won't automatically recompile the app. So make sure you rebuild (recompile) before running the app. If this doesn't make sense, see this[^] link.
/ravi
|
|
|
|
|
I have found that doing a clean then a build sometimes helps. I have had to restart VS to get some things to happen. Not sure what problem VS has but it sure seems quirky to me. In the worst cases I have had to manually clean the obj and bin folders. Although that can cause other flaky things.
Jack of all trades, master of none, though often times better than master of one.
|
|
|
|
|
I see questions/comments like this quite often here, and yet I have never seen this problem first hand. I don't find VS quirky at all, I find it a very resilient application (even the Express versions).
|
|
|
|
|
I think it depends what you are doing.
I didn't find the WPF in 2008 at all robust, and try playing with abstract base UserControls in WinForms and you are heading for a world of pain in any version of VS post 2005!
Even in 2010 there are some flaky moments when the editor refuses to display any changes - though it applies them to the file just to be annoying...reboot VS fixes it.
It's a complex program, and I guess if you use the flaky bits you get a flaky product - it you use the stable bits you get a stable product!
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
There's a fatal thing in Visual Studio. Normally when a build fails as a result of hitting F5 a little dialog pops up telling you its failed and asking if you want to run the previous version. NEVER select 'don't show this again' as it can be less that obvious that your build has failed and your running an out of date .exe.
If you've done this, that will be why and you need to trawl through the endless settings to undo it.
Regards,
Rob Philpott.
|
|
|
|
|
It's sheer brilliance that one can hide that dialog for ever
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I have a small prototype that allows a user to highlight a rectangle on an image. The program will analyze this highlighted portion and change the pixels properties of the pixels. Above a certain treshold it will set it to white, below the treshold the pixel is set to orange.
This stuff works using the SetPixel/GetPixel method, but I read that performance is better with the LockBits/UnlockBits method.
So I tried the following:
System.Drawing.Imaging.BitmapData bmpdata = tmpbmp.LockBits(tmprect, System.Drawing.Imaging.ImageLockMode.ReadWrite, tmpbmp.PixelFormat);
IntPtr pointer = bmpdata.Scan0;
int nrofbytes = bmpdata.Width * bmpdata.Height;
byte [] bytes = new byte[nrofbytes];
System.Runtime.InteropServices.Marshal.Copy(pointer, bytes, 0, nrofbytes);
System.Drawing.Color color_white = System.Drawing.Color.White;
System.Drawing.Color color_orange = System.Drawing.Color.Orange;
long count = 0;
for(int i = 0; i < bytes.Length-3; i+=3){
if(bytes[i] > 235 && bytes[i+1] > 235 && bytes[i+2] > 235){
bytes[i] = color_white.R;
bytes[i+1] = color_white.G;
bytes[i+2] = color_white.B;
}
else{
count++;
bytes[i] = color_orange.R;
bytes[i+1] = color_orange.G;
bytes[i+2] = color_orange.B;
}
}
System.Runtime.InteropServices.Marshal.Copy(bytes, 0, pointer, nrofbytes);
tmpbmp.UnlockBits(bmpdata);
This doesn't work in the sense that the highlighted part is:
1. not white/orange, but rather white/gray
2. it changes entire rows of the image instead of the rectangle portion I passed.
for 1. it might be some sort of index offset, I guess.
I'm pretty sure the culprit for 2. is this line:
System.Runtime.InteropServices.Marshal.Copy(bytes, 0, pointer, nrofbytes);
but I'm not sure why or how to solve it.
Anyone have any experience with this?
Many thanks.
|
|
|
|